views:

741

answers:

4

I just wonder - if I need to deploy an assembly into the GAC, what is the "official" way of doing it?

Currently we either manually drag/drop into the c:\windows\assembly folder or we use gacutil.exe. The first way is obviously not the good one (it's manual process after all), and gacutil is part of the SDK and not available per default on production servers.

Are there any Microsoft deployment Guidelines?

+8  A: 

The simplest way by far is using a Setup project. There, you can just add assemblies from your project output(s) into a special GAC folder, and the installer will add them to the GAC for you.

Tor Haugen
Can you provide detail on that - I am thinking of using some gacutil commmandline code in a custom installer - is that what you are referring to as well?
Vidar
+1  A: 

If you're not using an existing installer technology, the "official" way is through the IAssemblyCache::InstallAssembly native API. But a managed alternative can be found in the System.EnterpriseServices.Internal namespace. Despite the name, it is in fact a public class in a standard assembly.

Publish.GacInstall

Josh Einstein
+1  A: 

Try this :

Sample Managed GAC API Wrappers http://blogs.msdn.com/junfeng/articles/229649.aspx

Amitd
A: 

I have tried this link.

Sample Managed GAC API Wrappers http://blogs.msdn.com/junfeng/articles/229649.aspx

The above code install the assemblies into the C:\Windows\Assembly

How can i install the assemblies in the C:\Windows\MicroSoft.NET\Assemblies\GAC_MSIL. I mean i want want to install the .NET Framework 4.0 GACAPI.

velusamy