How do I add a modified dll to the Global Assembly Cache?

3.2k views Asked by At

I have the MySQL Connector/NET installed on my PC. I modified the source code and recompiled one of the dlls (MySQL.Data.dll). With the program already installed, how can add this dll to the Global Assembly Cache?

If your answer involves using gacutil.exe, please tell me where I can find it on my PC or where I might download it. Thanks!

5

There are 5 answers

3
Henk Holterman On BEST ANSWER

You can put it in the GAC but unless you have access to the private key with which it was originally signed, the installed program(s) will not recognize it.

0
Darin Dimitrov On

Open Windows Explorer (WindowsKey+E). Go to c:\windows\assembly. Open a second explorer window and drag and drop your assembly to the first window.

0
Rubens Farias On
"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\gacutil.exe" /i "strongnamed.dll" /f /nologo
0
Vitaliy On

Very simple: Start-> Programs-> Microsoft Visual Studio 2005/2008 -> Visual Studio Tools -> Visual Studio 2005/2008 command prompt

a cmd appears, where you can type gacutil.

It also shows you the path where it resides:

C:\Program Files\Microsoft Visual Studio 9.0\VC> on my computer.

0
Peter Tadros On
  1. Open Visual Studio Command Prompt

First open Visual Studio Command Prompt (For Visual Studio 2010 the path is Programs --> Visual Studio 2008 --> Visual Studio Tools --> Visual Studio 2008 Command Prompt ) All the files mentioned in the following steps will be created in the Visual Studio 2010 Command Prompt Path.

  1. Generate a KeyFile sn -k keyPair.snk
  2. Get the MSIL for the assembly ildasm SomeAssembly.dll /out:SomeAssembly.il
  3. Rename the original assembly, just in case ren SomeAssembly.dll SomeAssembly.dll.orig
  4. Build a new assembly from the MSIL output and your KeyFile ilasm SomeAssembly.il /dll /key=keyPair.snk
  5. Install the DLL in to the GAC gacutil -i SomeAssembly.dll