Sign in to follow this  
Little Coding Fox

Strange bug with DLLNotFoundException

Recommended Posts

Greetings everyone, I have a C# program that calls C functions from a Native C++ DLL, using the DLLImport attribute on some functions. However, whenever i try to call any of the functions, i get a DLLNotFoundException. I have the C# program compile to x86 only, and the DLL is in the exact same folder as the executable, yet it will constantly tell me the DLL could not be found, "The module could not be found". However, if i e.g., copy the program's executable and rename it as the DLL's filename, it'll instead tell me it can't find the entry points it needs, which means it did find and load the "DLL". I have the DLL's functions being exported with C linkage, and i'm using Visual Studio 2008 Professional. I'm also sure the Working Directory is correct. Even running the program on the same folder as the DLL will terminate with a crash (uncaught Exception). Would anybody have any idea as to what could be causing this strange behaviour? Thank you very much for your time regarding this message, and have a nice day!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this