Link to home
Create AccountLog in
Avatar of dedekind
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?
Avatar of dedekind
dedekind

ASKER

Just so you know, I also tried adding the EXE file's directory to the PATH variable on my friend's machine. That didn't work either. But in my opinion this is just as insane, because does one really want to add a new PATH to a client's machine just to run one's app? Clients would find that painful with time.
ASKER CERTIFIED SOLUTION
Avatar of Gautham Janardhan
Gautham Janardhan

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
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
I'll check this out in the next few days and then get back to you. Thanks so far!
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.