views:

1088

answers:

8

I have made a .Net dll, which i want to register in GAC. I have used this command in windows server 2003 Command Prompt.

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

it says path is not correct.

Do i need to use this in .Net cmd prompt ,if it is that' i am not able to locate .Net cmd promt' .

Please Suggest!!

A: 

Just drag and drop the dll in C:\Windows\assembly using Windows Explorer

Ando
+2  A: 

Try GACView if you have a fear of command prompts.

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

abmv
+4  A: 

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

gacutil /i yourdll.dll

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

Fredrik Mörk
Vineet seems to know this already.
Moron
+1  A: 

Here is a link to a wiki about it

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 can register a shared assembly in the GAC by using the command:

gacutil.exe /i "assemblyName"

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

%windir%\assembly\

Other options for this utility will be briefly described if you use the /? flag, i.e.: gacutil.exe /?

tbischel
A: 

I suggest you post a snapshot of what you typed in and the output you get after considering the below two things:

  • Is gacutil in your path?
  • You seem to have typed gacutil/i without any spaces between gacutil and /i.
Moron
+1  A: 

as ando said just drag and drop the assembly to the c:\windows\assembly it works

+2  A: 

You'll need:

  • Strong name your assembly (Visual Studio, Project Properties, 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 8\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.

Rubens Farias
A: 

These responses don't tell you that gacutil resides in C:\WINDOWS\Microsoft.NET\Framework\v1.1* by 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 earlier and that was easier and does work, as long as it's a .NET library. I also tried a COM library and this failed with an error that it was expecting an assembly manifest. I know that wasn't the question here, but thought I'd mention that in case someone finds out they can't add it, that that might be why.

-Tom

Tom