I take made a .Cyberspace .DLL file, which I desire to register in the GAC.

I take used this command in Windows Server 2003 Command Prompt:

                C:\"Path of dll"\>gacutil /i dllname.dll 'gacutil' is not recognized equally an internal or external command, operable program or batch file.                              

It says the path is not right.

Practice I need to use this in a .Internet cmd prompt? If it is that, I am not able to locate the .NET cmd prompt.

user avatar

Ian Boyd

232k 236 gilded badges 832 silverish badges 1152 bronze badges

asked Feb two, 2022 at 6:50

user avatar

ane

You tin practice that using the gacutil tool. In its simplest course:

                  gacutil /i yourdll.dll                                  

You find the Visual Studio Control Prompt in the start menu under Programs -> Visual Studio -> Visual Studio Tools.

user avatar

answered Feb 2, 2022 at 6:54

user avatar

iii

You'll need:

  • Strong name your associates (Visual Studio, Project Backdrop, Signing tab, Sign the assembly)
  • Alter your Build Events (Project Properties, Build Events tab, Post-build command line)
                  cd C:\Program Files\Microsoft Visual Studio viii\SDK\v2.0\Bin    gacutil.exe /i "$(TargetPath)" /f /nologo    gacutil /l "$(TargetName)" /nologo                

Now, everytime you build your project, it'll be installed on GAC.

answered Feb 2, 2022 at 9:ten

user avatar

ane

Simply drag and drib the DLL file into folder C:\Windows\assembly using Windows Explorer.

Caveat:

In before versions of the .NET Framework, the Shfusion.dll Windows shell extension let you install assemblies by dragging them to File Explorer. Offset with .Net Framework 4, Shfusion.dll is obsolete.

Source: How to: Install an associates into the global assembly enshroud

user avatar

wp78de

17.2k 6 gold badges 36 silver badges 67 bronze badges

answered February 2, 2022 at 6:52

user avatar

iv

These responses don't tell you that gacutil resides in C:\WINDOWS\Microsoft.Net\Framework\v1.1* past the way.

I didn't have it in my v2.0 folder. But I tried dragging & dropping the DLL into the C:\WINDOWS\Assembly folder as was suggested here before and that was easier and does work, as long equally it'south a .Internet library. I also tried a COM library and this failed with an error that information technology was expecting an assembly manifest. I know that wasn't the question here, merely idea I'd mention that in case someone finds out they can't add it, that that might be why.

-Tom

answered Jun 24, 2022 at 0:05

user avatar

1

From Wikipedia:

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

One can check the availability of a shared assembly in GAC by using the command:

                  gacutil.exe /l "assemblyName"                                  

One tin annals a shared associates in the GAC past using the command:

                  gacutil.exe /i "assemblyName"                                  

Or by dropping an associates file into the following location using the GUI:

                  %windir%\assembly\                                  

Other options for this utility volition be briefly described if you use the /? flag, that is:

                  gacutil.exe /?                                  

user avatar

answered Feb 2, 2022 at half dozen:56

user avatar

i

Endeavour GACView if yous take a fright of command prompts.

You have not set the PATH properly in DOS.Yous need to point the path to where the gacutil resides to use it in DOS.

answered Feb 2, 2022 at 6:54

user avatar

0

  • Run Developer Control Prompt For V2012 or any version installed in your arrangement

  • gacutil /i pathofDll

  • Enter

Done!!!

answered April xiv, 2022 at ten:22

user avatar

1

As ando said, simply drag and drop the assembly to the C:\windows\assembly folder. Information technology works.

user avatar

answered Feb ii, 2022 at vii:07

user avatar

2

The above solutions wait marvelous. However, to be uncomplicated, all you lot need I gauge is to enter the assembly name along with its full path like:

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

Paying attention to C:\MyDlls\GacDeployedAssemblies

user avatar

Draken

3,109 thirteen gold badges 34 silver badges 52 bronze badges

answered Sep 12, 2022 at 14:xi

user avatar

In instance on windows vii gacutil.exe (to put associates in GAC) and sn.exe(To ensure uniqueness of assembly) resides at C:\Plan Files (x86)\Microsoft SDKs\Windows\v7.0A\bin

Then go to the path of gacutil every bit shown below execute the beneath control after replacing path of your assembly

C:\Plan Files (x86)\Microsoft SDKs\Windows\v7.0A\bin>gacutil /i "supersede with path of your assembly to be put into GAC"

answered Feb 28, 2022 at 6:26

user avatar

Also available using .NET Framework Assemblies in PowerShell.

                [Organisation.Reflection.Assembly]::Load("Organization.EnterpriseServices, Version=four.0.0.0, Civilization=neutral, PublicKeyToken=b03f5f7f11d50a3a") $publish = New-Object System.EnterpriseServices.Internal.Publish      $publish.GacInstall("C:\path_to_dll_file\file.dll")                              

Was searching some solution lately, tested this i before I constitute relevant info here.

answered October 20, 2022 at 13:27

user avatar

From the Publish tab go to application Files.

And so, click unnecessary files.

After that, exercise the exclude printing ok.

Finally, build the project files and run the projects.

user avatar

dan1st

9,356 6 aureate badges 25 argent badges 53 statuary badges

answered Jul 25, 2022 at 7:11

user avatar

0

I tried but about everything in the comments and information technology didn't work. And so I did gacutil /i "path to my dll" from Powershell and it worked.

Too remember the fob of pressing Shift when you lot right-click on a file in Windows Explorer to get the option of Copy path.

answered Aug 18, 2022 at eight:30

user avatar

Not the reply you're looking for? Browse other questions tagged c# gac dllregistration or ask your own question.