June 3rd, 2013, 03:31 PM
Dll reference imported as interop?
Hello again, once more I'm having an old problem with referencing libraries. From my VS2010 project window, I add a reference to a .dll file, either selecting the file itself or from the COM tab list, and my project runs perfectly. The bin\Release\.exe file also runs ok. Not sure why, but the dll I import is copied as Interop.dllname.dll, even if referenced from the COM tab when added, which I'm assuming is something like the GAC?
The DLL is a 3rd party library and the software that uses it may be installed on the target computers.
The problem is, when I copy the file and dll to another computer that has that software installed, then my app doesn't work. It loads ok, but when I push a button that triggers use of the DLL I get a "The app stopped working" messagebox.
How can I check which library/version/culture/whatever my app is looking for and what it is actually finding? I read the search order is GAC first, app domain second and executable path third, so I'm guessing if a DLL with the same name is already registered but it is another version, it would crash. The problem is I am adding a reference to the same DLL registered in the target machines, so I'm referencing the same DLL version as far as I know... not really sure that's the reason.
I also looked up how to bypass GAC and go straight to local exe directory for searching dlls, but I could not figure out the System.Reflection.Assembly stuff. I found something about having a exefilename.exe.local file in the same directory as the exe file, that would trigger the OS to search for dlls in that path instead of GAC first, but it didn't work for me (in Win7)
It's nuts... the people that have to original app and want to use my support app can't use it...!
Anyway, thanks a lot again for any help!
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!