简体   繁体   English

将“程序集”部署到GAC的“官方”方式?

[英]“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? 我只是想知道 - 如果我需要将一个程序集部署到GAC中,那么“官方”的方式是什么?

Currently we either manually drag/drop into the c:\\windows\\assembly folder or we use gacutil.exe. 目前我们手动拖放到c:\\ windows \\ assembly文件夹或我们使用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. 第一种方式显然不是好方法(毕竟它是手动过程),gacutil是SDK的一部分,在生产服务器上默认不可用。

Are there any Microsoft deployment Guidelines? 是否有任何Microsoft部署指南?

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. 在那里,您只需将项目输出中的程序集添加到特殊的GAC文件夹中,安装程序就会将它们添加到GAC中。

Try this : 试试这个 :

Sample Managed GAC API Wrappers http://blogs.msdn.com/junfeng/articles/229649.aspx 示例托管GAC API包装器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. 如果您没有使用现有的安装程序技术,那么“官方”方式是通过IAssemblyCache :: InstallAssembly本机API。 But a managed alternative can be found in the System.EnterpriseServices.Internal namespace. 但是可以在System.EnterpriseServices.Internal命名空间中找到托管替代方法。 Despite the name, it is in fact a public class in a standard assembly. 尽管名称如此,它实际上是标准装配中的公共类。

Publish.GacInstall Publish.GacInstall

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

According to Install Shield ´s website: 根据Install Shield的网站:

InstallShield 2011: Microsoft's Installation Solution of Choice for Visual Studio 2010 Applications InstallShield 2011:Microsoft的Visual Studio 2010应用程序选择安装解决方案

  • retrieved on 12-feb-2011 在2011年12月12日检索

A tool I've used to build installers that can be automated is Wix . 我用来构建可以自动化的安装程序的工具是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. Wix能够为我们做出一切可管理的事情。 The way Wix works is that you describe everything in Xml files. Wix的工作方式是您在Xml文件中描述所有内容。 One of the benefits is that you can keep the XML under source-control. 其中一个好处是您可以将XML保持在源代码控制之下。

Here's some blog posts about how to use Wix to deploy dlls to both the GAC and locally: 这里有一些关于如何使用Wix将dll部署到GAC和本地的博客文章:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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