0

My C# Framework 4.6.1 project references a Net DLL. (DLibDotNet.Native.DLL)

My project compiles fine. I clean the project, rebuild it, it still works fine.

Now when I remove reference to the DLL and add it anew, I get the error message

Couldn't add reference to DlibDotNetNative.dll. Make sure that the file is accessible and that it's a valid assembly or COM component.

Trying to use TlbImp.exe returns the following error:

"The input file is not a valid type library."

What might be the reason why it can't be referenced again once de-referenced?

tmighty
  • 10,734
  • 21
  • 104
  • 218
  • This could be helpful for you https://stackoverflow.com/questions/3456758/a-reference-to-the-dll-could-not-be-added – umesh shukla Sep 16 '18 at 16:16
  • @umeshshukla It doesn't. Tlbimp.exe tells me "The input file is not a valid type library." – tmighty Sep 16 '18 at 16:25
  • 1
    It is not obvious why you are messing with this, leave it up to the Nuget package installer to get it right. The package supplies two DLLs, DlibDotNet.dll is the managed wrapper that you add as a reference, DlibDotNet.Native.dll is an unmanaged DLL that it pinvokes. You can't add it as it reference and it must be copied into the client EXE build directory. – Hans Passant Sep 16 '18 at 16:25
  • Oohhhhh my eyes got really bad. I spotted it in "References" although it resides one level below in the hierarchy. – tmighty Sep 16 '18 at 16:34

0 Answers0