dedekind
asked on
How to NOT run gacutil to load assemblies?
I am using this 3rd party (proprietary) library. I have installed it on my computer using its Windows installer. I then reference the library in Visual Studio.
When the app is run on my machine it therefore works fine, as the library has been properly installed.
However when I send my app to a friend's computer, and send along the library's DLL files (I put the DLL files in the same directory as the app's EXE file), the app crashes because it didn't find the library.
It seems now that I have found out that I need to run "gacutil /i thelibrary.dll" on the friend's computer in order for it to work properly. Otherwise it seems the assembly doesn't get installed properly in the GAC (Global Assembly Cache).
But isn't this a bit ridiculous? I don't want to ask my clients to keep running their own gacutil! Just insane. They might not even have Visual Studio --- and therefore not gacutil --- installed on their machines!
How can I address this issue?
When the app is run on my machine it therefore works fine, as the library has been properly installed.
However when I send my app to a friend's computer, and send along the library's DLL files (I put the DLL files in the same directory as the app's EXE file), the app crashes because it didn't find the library.
It seems now that I have found out that I need to run "gacutil /i thelibrary.dll" on the friend's computer in order for it to work properly. Otherwise it seems the assembly doesn't get installed properly in the GAC (Global Assembly Cache).
But isn't this a bit ridiculous? I don't want to ask my clients to keep running their own gacutil! Just insane. They might not even have Visual Studio --- and therefore not gacutil --- installed on their machines!
How can I address this issue?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
You are right that it was False before. However changing it to True, and then rebuilding (after cleaning the solution to be safe) appears not to have changed anything. No new DLL files were introduced into the release folder or anything. just the same. I tried running it again on the friend's machine (or equivalently, on my machine with the 3rd party library properly uninstalled) and I get the same "Could not load file or assembly" run-time error :(
when u change it to true .. it shud actually be included in ur build...can u refresh the dependecies in the release project
ASKER
I'll check this out in the next few days and then get back to you. Thanks so far!
ASKER
Thanks dude. CopyLocal does the trick. Then the DLL files get copied to the Release folder and can then accompany the exe file whereever it goes.
ASKER