简体   繁体   中英

“Official” Way to deploy Assemblies into the GAC?

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?

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.

Try this :

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

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

另一种选择是使用像InnoSetup这样的工具。

According to Install Shield ´s website:

InstallShield 2011: Microsoft's Installation Solution of Choice for Visual Studio 2010 Applications

  • retrieved on 12-feb-2011

A tool I've used to build installers that can be automated is Wix . We had different installers for trial versions, full versions, and for the many different products that we had to manage. Wix was able to make all that manageable for us. The way Wix works is that you describe everything in Xml files. One of the benefits is that you can keep the XML under source-control.

Here's some blog posts about how to use Wix to deploy dlls to both the GAC and locally:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM