简体   繁体   中英

How to register dll in GAC with .Net MSI

When we build .net MSI, what are the steps to register the dlls in GAC? I want to msi, for copying and registering the dlls. Is it possible?

If you have an VS Setup Project

After adding your outputs and files etc.

Right click on your msi project app root and choose view then File System

Here you will see where all your files are installing and also notice a Global Assembly Cache Folder . By dragging and dropping the dlls you want to be in the GAC into this folder, when you running your msi it will install all of your dlls into the GAC.

As an aside Be careful when installing this onto your local machine, if you are trying to run a debug routine and have a reference to a version of a dll that exist in your GAC it will use this reference instead of the one in your solution.

A fix for this is to change the version number of the relevant project in your VS solution as soon as you have added the latest version to the GAC.

Typically, the software you use to generate the .msi (such as a VS Setup Project, WiX, or most other tools) will provide you with an option to register the assembly in the GAC.

However, you can use Gacutil.exe to manually register or uninstall an assembly from the GAC.

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