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

女生的网名这么多〃 提交于 2019-12-12 01:17:10

问题


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!


回答1:


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.




回答2:


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.




回答3:


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



回答4:


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.




回答5:


  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


来源:https://stackoverflow.com/questions/1574555/how-do-i-add-a-modified-dll-to-the-global-assembly-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!