How to register a .NET DLL file in a GAC?

I made a .NET .DLL file that I want to register with the GAC .

I used this command on the Windows Server 2003 command line:

 C:\"Path of dll"\> gacutil /i dllname.dll 

This says the path is wrong.

Do I need to use this on the .NET command line? If so, I cannot find the .NET cmd prompt.

+73
c # gac
02 Feb '10 at 6:50
source share
11 answers

You can do this using the gacutil tool. In its simplest form:

 gacutil /i yourdll.dll 

You will find the Visual Studio command prompt in the Start menu under Programs β†’ Visual Studio β†’ Visual Studio Tools.

+90
Feb 02 2018-10-02T00
source share

You will need:

  • The strong name of your assembly (Visual Studio, Project Properties, Signing tab, Sign the assembly)
  • Changing assembly events (Projects tab, Events tab, Command line after assembly).
    cd C: \ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ Bin
    gacutil.exe / i "$ (TargetPath)" / f / nologo
    gacutil / l "$ (TargetName)" / nologo

Now, every time you create your project, it will be installed on the GAC.

+31
Feb 02 '10 at 9:10
source share

Just drag and drop the dll file into the C:\Windows\assembly folder using Windows Explorer.

Warning:

In earlier versions of the .NET Framework, the Windows shell extension for Shfusion.dll allowed assemblies to be installed by dragging and dropping them into Windows Explorer. Starting with the .NET Framework 4, Shfusion.dll is deprecated.

Source: How to: Install an Assembly in the Global Assembly Cache

+17
Feb 02 '10 at 6:52
source share

These answers do not tell you that gacutil is located in C: \ WINDOWS \ Microsoft.NET \ Framework \ v1.1 * by the way.

I did not have it in the v2.0 folder. But I tried to drag the DLL into the C: \ WINDOWS \ Assembly folder, as suggested here earlier, and it was easier and works if it is a .NET library. I also tried the COM library, and this failed with an error awaiting the assembly manifest. I know that this is not a question, but I thought that I would say that if someone finds out that they cannot add it, that’s probably why.

-Tom

+12
Jun 24 2018-10-06T00:
source share

From Wikipedia :

gacutil.exe is the .NET utility used to work with the GAC.

You can check the availability of the general assembly in the GAC using the command:

 gacutil.exe /l "assemblyName" 

You can register a general assembly in the GAC using the command:

 gacutil.exe /i "assemblyName" 

Or by dropping the build file in the following location using the GUI:

 %windir%\assembly\ 

Other options for this utility will be briefly described if you use the /? Flag , which the:

 gacutil.exe /? 
+10
Feb 02 2018-10-02T00
source share
  • Run the developer command line command for V2012 or any installed version on your system

  • gacutil / i pathofDll

  • Enter

Done !!!

+4
Apr 14 '15 at 10:22
source share

Try GACView if you have fear of command prompts.

You did not set PATH correctly in DOS. You need to specify the path to where gacutil is in order to use it in DOS.

+3
Feb 02 2018-10-02T00
source share

As ando said, just drag the node to the assembly folder C: \ windows \. He works.

+3
Feb 02 '10 at 7:07
source share

If on windows 7 gacutil.exe (for assembling the assembly in the GAC) and sn.exe (for ensuring the uniqueness of the assembly) is located in the folder C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ bin

Then go to gacutil path as below, run the following command after replacing your build path

C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ bin> gacutil / i "replace the path of your assembly that will be placed in the GAC"

+1
Feb 28 '17 at 6:26
source share

From the Publish tab, go to the Files app, and then unnecessary files make an exception than ok. Create project files. And complete the projects.

+1
Jul 25 '17 at 7:11
source share

The above solutions look amazing. However, to be simple, all you need, I think, is to enter the assembly name along with its full path, for example:

 gacutil -i C:\MyDlls\GacDeployedAssemblies\dllname.dll 

Pay attention to C: \ MyDlls \ GacDeployedAssemblies

0
Sep 12 '16 at 14:11
source share



All Articles