Question

  • 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.

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top