Search code examples
c#visual-studio-2010dllvisual-studio-express

Loading DLLs with Microsoft Visual C# 2010 Express


I'm using Microsoft C# 2010 Express with the FrameLink Express drivers from Imperx. When I try to load the DLL at runtime, I get an exception:

Unable to load DLL 'VCECLB.dll': The specified module could not be found. (Exception from HRESULT:0x8007007E)

If I try to add the DLL as a reference, I get this message:

A reference to 'C:\\VCECLB.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

Two questions:

  1. Is this an Express problem (i.e. some limitation with Express causing the problem)? I believe the source for the DLL is written in C++, but I wouldn't think that would matter.

  2. Is there a different way to reference the DLL and/or add it to the project? Something I'm doing wrong?

Finally, I've tried adding both the x86 and x64 versions, debug and release. Same failure to add as a reference every time.


Solution

  • That DLL doesn't seem to be .NET (nor COM) code - therefore you cannot load it, nor add a reference to it.

    Doesn't have anything to do with your Express version - it's just not a .NET "compatible" DLL and thus you can't load or reference it.

    In order to use its functionality, you'll probably have to dive into more "arcane" (and more elaborate and more complicated) methods of calling raw C++ code from .NET - or find a .NET compatible counterpart or version of it.