user1173240
user1173240

Reputation: 1475

Installing a .NET assembly into GAC using MSI

I wish to install a .NET assembly into the GAC using a Setup project, MSI. While I have a general idea on how to go about it, does the assembly need to be signed before the MSI installs it, and if so, in a production environment, how is the assembly supposed to get signed?

i.e. what can I set up on Visual Studio /InstallShield to sign the assembly automatically, and then install it via the MSI on the target machine GAC?

Also, if I uninstall the application, would the assembly loaded in theGAC, be removed as well?

Do help me out. Thank you.

Upvotes: 1

Views: 541

Answers (1)

Michael Urman
Michael Urman

Reputation: 15905

Publishing an assembly to the GAC requires that the assembly have a strong name. This is a form of signing that does not use traditional certificate-authority based digital certificates. InstallShield, at least, offers no particular suppport for applying a strong name to an assembly, but Visual Studio offers the option to do so from within the project.

Once your assembly has a strong name, it can be installed to the GAC. Once the MSI is configured correctly (assuming you're using an MSI), it will remove it (or at least decrement the reference count) on uninstallation.

Upvotes: 4

Related Questions