DLLImport and Unable to Load DLL

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?
 
M

Michael Tissington

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top