DLLImport and Unable to Load DLL

  • Thread starter Thread starter Michael Tissington
  • Start date Start date
M

Michael Tissington

I have a C# function that calls into a C++ DLL

I have placed the DLL in the 'bin' folder of my asp.net project

I'm using something like
[DllImport("Keycode.dll", EntryPoint="GenerateKey")]

However when I try to call the function I'm getting an error 'Unable to Load
DLL'

Should I specifiy the path to the dll in the DllImport?
If so - do I specifiy a path relative to the web site or a physical path?

Anything else that could be causing this error?
 
Mattias,

Thanks for the LoadLibrary link, however this does not seem to work when
running as an ASP.NET web page.

I guess I need to get the path to the original location of the page and not
the temporary location of the assembly.
 
Back
Top