Search code examples
windows-installergacsetup-deploymentvisual-studio-setup-proje

A strongly-named dll is not installing to GAC when added to GAC Folder in setup-deployment project


I'm attempting to install a dll shared by multiple projects to the GAC, using Visual Studio's setup and deployment project. I've strongly named my assembly, and set the output folder of the project primary output to 'Global Assembly Cache folder'.

Strongly named assembly capture

Project output properties capture

File System of Setup Project

After building and installing the executable, I've received no errors. However, using the GacUtil, I can confirm that the dll was not added to the GAC. What am I missing?

I've scoured Stackoverflow and other sources, but haven't found an explanation.

GAC Util output


Solution

  • Assembly Tables: I'll just add an attempted answer, no time to test. In the compiled MSI of yours, is there anything in the tables MsiAssembly and MsiAssemblyName? Are the tables there at all? And it seems manual installation to the GAC works fine? (so no strong name issues).

    GAC Folder: Not entirely clear if you have right clicked the "File System on Target Machine" top node and done Add Special Folder => Global Assembly Cache Folder?

    GAC

    "Add Assembly...": Make sure you add the file as an assembly as illustrated here, and add it to the Global Assembly Cache folder:

    Assembly

    A Tale of Two GACs: I am not up to speed on the new GAC. Just an issue to be aware of and test. How to view the Folder and Files in GAC?:

    • .NET 1.0 - NET 3.5: c:\windows\assembly (%systemroot%\assembly)
    • .NET 4.x: %windir%\Microsoft.NET\assembly

    Alternative Tools: Recommend you go for WiX or another tool. And yes, there are some good reasons why. Here is a WiX quick-start tip collection. Advanced Installer has some free features for simple requirements.


    Links: