none
How Do I Add Assemblies into GAC in Server 2008r2 RRS feed

  • Question

  • We have migrated some of our servers to Server 2008 r2 (2k8r2) and need to add some custom assemblies to the GAC. Before 2k8r2, one would drop the dll into the C:\Windows\Assembly folder and that was it. This seems to be prevented in 2k8r2. I have seen many workarounds for 2k8 such as opening CMD as admin, calling explorer from the command prompt (which should start explorer as an admin), and then copying but this does not work in 2k8r2. I have seen others ask specifically about 2k8r2 and they usually end up using the gacutil as no answer is forthcoming but we do not want to use that on our production servers.

    So, without using the gacutil, and knowing that 2k8r2 does not allow the admin to copy into the C:\Windows\Assembly folder, what is MS's suggested way of adding assemblies to the GAC in 2k8r2?

    Thanks

    • Moved by Andrew.Wu Monday, October 3, 2011 8:09 AM (From:.NET Framework Setup)
    Friday, September 30, 2011 4:00 PM

Answers

  • Just explanation about "copying files into C:\Windows\assembly". That was a weird feature that did exactly the same what gacutil.exe does. The feature (integration into explorer) was removed and I don't think we support it anymore with newer versions of .NET.

    Using gauctil.exe or installer are the 2 recommended ways.

    To troubleshoot installer problems I would recommend to use ClickOnce and Setup & Deployment Projects forum.
    Without being an expert on installer: I think it should basically do the same thing as gacutil.exe as well. Try to use gacutil.exe to see if you get into the same weird situation. That will help you understand if there is something wrong with the assembly or with your setup project.

    -Karel

    • Marked as answer by Paul Zhou Monday, October 10, 2011 7:29 AM
    Thursday, October 6, 2011 5:20 AM
    Moderator

All replies

  • Hi,

    You can follow the links below to install assemblies to GAC.

    How to: Install an Assembly into the Global Assembly Cache

    How to install an assembly in the Global Assembly Cache

     

    Have a nice day.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, October 3, 2011 7:19 AM
  • Unfortunately, niether of those links has the answer but did lead me to the right place. I probably should have mentioned that the assemblies are 3rd party dlls and are not built in house.

    The first link (which I had been to a few times in researching) mentions three methods, one using the Windows Installer but doesn't really explain how or give a link to the answer of how to do that. The second link ends by telling the user to use the gacutil or to copy the file into the assembly folder; both of which I have already stated are not possible. But the revisit to the first link sent me back down the Install path and I found this link which shows how to create an install for an existing assembly to the GAC - http://support.microsoft.com/kb/324168

    Thanks for your assistance.

    Mike


    Mike
    • Edited by Manxus Monday, October 3, 2011 4:48 PM
    Monday, October 3, 2011 4:47 PM
  • I have now used the Installer to add the dll to the GAC but I'm seeing an issue. The processor architecture is blank when looking in the GAC. If I open the msi file with orca, the MsiAssemblyName table has MSIL as the ProcessorArchitecture Value but when I look in the GAC, the field is blank. I have read in numerous blogs that this will prevent an uninstall, and it does.

    I have used both VS2008 Database Edition (SP1) and VS2010 Ultimate (SP1) to create the installer and both have had the same result.

    Hopefully, I'm just missing somethig basic.

    Thanks


    Mike
    Wednesday, October 5, 2011 9:46 PM
  • Just explanation about "copying files into C:\Windows\assembly". That was a weird feature that did exactly the same what gacutil.exe does. The feature (integration into explorer) was removed and I don't think we support it anymore with newer versions of .NET.

    Using gauctil.exe or installer are the 2 recommended ways.

    To troubleshoot installer problems I would recommend to use ClickOnce and Setup & Deployment Projects forum.
    Without being an expert on installer: I think it should basically do the same thing as gacutil.exe as well. Try to use gacutil.exe to see if you get into the same weird situation. That will help you understand if there is something wrong with the assembly or with your setup project.

    -Karel

    • Marked as answer by Paul Zhou Monday, October 10, 2011 7:29 AM
    Thursday, October 6, 2011 5:20 AM
    Moderator
  • That feature was much appreciated while it was available-

    Mike

    Wednesday, May 23, 2012 5:35 PM