How to add a dll to gac in vista

后端 未结 6 720
谎友^
谎友^ 2021-01-12 17:09

When I drag & drop a dll to the assembly folder on vista, I get the error \"Access is denied: mydll.dll\". How can I bypass the error message and add my dll to gac?

6条回答
  •  庸人自扰
    2021-01-12 17:48

    Using Command line, use the following steps:

    Open Visual Studio Command Prompt

    First open Visual Studio Command Prompt (For Visual Studio 2008 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 2008 Command Prompt Path. In my case it is C:\Program Files\Microsoft Visual Studio 9.0\VC

    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

提交回复
热议问题