What's the 'correct' way of registerin

2019-01-09 06:29发布

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?

In response to Lou Franco (and gacutil):

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.

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.

In response to using WIX:

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?

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

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!

8条回答
何必那么认真
2楼-- · 2019-01-09 07:27

use gacutil.

Advantages: seems to always work. Disadvantages:

  • must package an additional executable with your installer.
  • As a development utility, seems to have additional side effects (like forcing the install no matter what).
  • Should NOT be included in any redistributable given to customers.
查看更多
看我几分像从前
3楼-- · 2019-01-09 07:29

Doesn't your installer maker have a way of installing an assembly into the GAC? On your own, I'd say GACUTIL:

http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx

查看更多
登录 后发表回答