什么是注册/安装的组件安装到GAC的“正确”的方式? [英] What's the 'correct' way of registering/installing an Assembly to the GAC?

查看:222
本文介绍了什么是注册/安装的组件安装到GAC的“正确”的方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎有许多不同的方式进行注册与GAC组件,如他们的工作。但是,什么是做的正确的方式?

There seems to be lots of different ways to register assemblies with the GAC, as in, they 'work'. However, what's the "proper" way of doing it?

在回应娄佛朗哥(和GACUTIL):

In response to Lou Franco (and gacutil):

我使用GACUTIL的发展,但在我看来是不安装它的正确方法,因为GACUTIL不包含在基本的.NET水电费过去.NET 1.1 - 这只是一个开发工具

I'm using Gacutil for development, but it seems to me to be not the proper way to install it, since gacutil isn't included in the basic .NET utilities past .NET 1.1 - it's only a developer tool.

其他:GACUTIL(如下面的反应所示)不是发行的,因此不应该在你打算给人们谁不开发任何应用程序中使用。 AKA,客户。请参阅<一href="http://blogs.msdn.com/astebner/archive/2006/11/04/why-to-not-use-gacutil-exe-in-an-application-setup.aspx">This博客文章(和评论)由Aaron Stebner 。

Additional: Gacutil (as seen in responses below) is not redistributable, and therefore should not be used in any app that you intend to give to people who are not developers. AKA, customers. See This blog post (and comments) by Aaron Stebner.

在针对使用维克斯:

维克斯可能是伟大的,所有的,但它是如何引擎盖下工作吗?什么细节让维克斯的方式安装的组件,以正确的方式来安装呢?如何看待它?它是一个系统/ .NET调用?是否有一个dll在System32中被埋的地方,需要进行一些电话吗?

WIX might be great and all, but how does it work under the hood? What details makes the way WIX installs the assembly the right way to install it? How does it look it up? Is it a system/.NET call? Is there some call in a dll buried somewhere in System32 that needs to be made?

(编辑:。它看起来像维克斯使用MSI引擎盖下见我的意见,在接受的答案)

( it looks like WIX uses MSI under the hood. See my comments in the accepted answer.)

最后编辑:它看起来像使用Windows安装程序安装程序集到GAC正确的方法,而不是其他。我想给维克斯一试。谢谢大家!

Final edit: It looks like the correct way to install an assembly to the GAC is using windows installer, and nothing else. I'm going to give Wix a try. Thanks all!

推荐答案

通过维克斯我会做这样的事情:

With Wix I would do something like this:



<DirectoryRef Id="MyDirectory" >
    <Component Id="MyComponent" Guid="PUT-GUID-HERE" DiskId="1">
        <File Id="MyAssembly" Name="MyAssembly.dll" Assembly=".net" KeyPath="yes" Source="MyAssembly.dll" />
    </Component>
</DirectoryRef>

当您使用属性大会=网在维克斯的文件,它会创建在MsiAssembly和MsiAssemblyName表项组件,并将其标记为GAC组成部分。

When you use the attribute Assembly=".net" for a file in WiX, it will create entries in the MsiAssembly and MsiAssemblyName table for this component and mark it as a GAC component.

这篇关于什么是注册/安装的组件安装到GAC的“正确”的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆