References issue
Hi everyone
I have to use a DLL in my application. I add it using the "Add reference", no problems, build is ok.
Now when I start the application it fails with an exception :
"A procedure imported by 'MgFdo, Version=3.0.6160.0, Culture=neutral, PublicKeyToken=null' could not be loaded."
This managed dll does indeed perform callbacks to some unmanaged dlls. Everything's fine if I copy all the dlls in my bin\debug (or release, whateve) but of course I don't want to do this.
What do I have to do ?
Thanks
[594 byte] By [
ytse] at [2007-12-25]
As with DLLs in the past, if they are not Com Dlls...then they need to reside in the Operating system environment path or in the local directory of the executing program. Since you do not want them in the local build directory, I suggest you place all the dlls in one location, such as C:\Dlls and setup your operating system environment path to have that directory in its list. The other option is to place them in an existing path that is referenced by the PATH environment variable...
Well the idea of your C:\DLL is what I've done (though not in the same name)
I'm using Windows XP Pro SP1, I've modified PATH vraiable in my environment variables in the advanced properties of "My Desktop" and it still won't work even after rebooting my computer. I'm completely lost...
You may want to run the program
Depends.exe. It used to be supplied in VC6 and possibly Visual Studio 2003. It is available in the SDKs...though I do not know which one off hand.
The program will take a dll and report all of its dependancies, going recursivley through sub dependancies, and graphically show if there are missing dll dependancies. If the situation is related to that, then you can identify the problem....or atleast remove this as a possible problem.