Hi all,
can anyone tell me how can i add an assembly to the GAC without using Visual Studio Command Prompt?Is there a manual way like copy and pasting? I know that using gacutil -i AssemblyName command in the command prompt i can do this.But i need an other way to do this.Any ideas?
Thanks in advance.

- 339
- 1
- 5
- 17
2 Answers
Installers, like WiX, are the way to go if you want to deploy your application.
I am not sure why you don't want to use the command prompt, but if you are looking on how to do it in code you could use the method GacInstall from the System.EnterpriseServices.Internal.Publish class.
new System.EnterpriseServices.Internal.Publish().GacInstall("YourAssemblyName.dll");
If you need more control you should look at the GAC/Fusion API. See here for an example written in C# for a PowerShell module controlling the GAC.
If all you want is a tool other than gacutil, then please use one that does use the proper APIs and does not manipulate the folder structure directly. Like this one for example.

- 42,837
- 6
- 126
- 143
Without using gacutil, may be you can try creating folder structure as mentioned below and copy your assembly there, c:\Windows\assembly\(YourAssemblyName)\(FullVersion)(PublicKeyToken) Finally copy YourAssemblyName.dll to the above folder.

- 1,525
- 11
- 24
-
2I would advise against this. That folder structure is internal to the GAC and should not be used directly. They also differ from .Net version to .Net version. – Lars Truijens Mar 12 '14 at 19:35
-
@LarsTruijens Thanks that you pointed out the usage of `new System.EnterpriseServices.Internal.Publish().GacInstall("YourAssemblyName.dll");`. I never came across this.. – Karthik Kalyanasundaram Mar 13 '14 at 11:59