0

I want to be able to use my DLL global so my exe will work even if the DLL is not in the same directory where the EXE is. So I read a lot about Global Assembly Cache And it says that I have to use gacutil.exe to register the DLL.

There are few problems: I have no Idea where the gacutil.exe is, it seems that it sits always somewhere else on every system. So I would have to use a recursive search for gacutil.exe and it will slow down the installation of my DLL. Or maybe check some registry keys.

On Windows XP I installed .NET 4 Framework but I could not find gacutil.exe anywhere.

I just tried to copy the gacutil.exe but the exe is not working on its own.

Is there a simple way to register my DLL in GAC? I don't want to mess around with gacutil. And I don't want to tell my clients to drag&drop the DLLs to GAC folder. I need a silent installation of my DLL. Or a system wide WORKING tool like regsvr32 in the old COM days...

MilMike
  • 12,571
  • 15
  • 65
  • 82
  • You just need to scratch the idea that "silent installation" is a feasible or acceptable way to get code deployed that has system-wide effects. Nobody likes to have their machine messed with like that. If you screw up then the machine owner has a hellacious time figuring out the cause and the fix. If "silent" really means "it should just work" then scratch that too, you really do have to create an installer. Use local deployment if that all sounds unattractive, it is the better DLL Hell solution anyway. – Hans Passant Nov 09 '13 at 17:08
  • possible duplicate of [What's the 'correct' way of registering/installing an Assembly to the GAC?](http://stackoverflow.com/questions/205188/whats-the-correct-way-of-registering-installing-an-assembly-to-the-gac) – oefe Nov 09 '13 at 17:38

2 Answers2

1

One of the solutions is to use the GacInstall method described below: MSDN

For more information see the following answer.

Community
  • 1
  • 1
Maxim Kornilov
  • 5,675
  • 1
  • 24
  • 35
-2

You can easily distribute gacutil utility with your assembly, just copy it with it. So during installation you run gacutil from installation folder.

Yevgeniy.Chernobrivets
  • 3,194
  • 2
  • 12
  • 14
  • 3
    gacutil is a development tool and should not be used to deploy on end-user machines http://blogs.msdn.com/b/astebner/archive/2006/11/04/why-to-not-use-gacutil-exe-in-an-application-setup.aspx – oefe Nov 09 '13 at 16:42