locked
Installing DLLto GAC on Windows Server 2003 RRS feed

  • Question

  • User1536948012 posted

    Hi,

    I have 3 related web sites developed in VS 2010 and I need to put all the common code in the GAC.  I created a separate project to do this, and using gacutil, got it all working great on my dev machine (Windows 7). 

       gacutil /i MyCommonCode.dll

    As a digression, "gacutil /l MyCommonCode" shows the dll is properly installed in the GAC, but it is not visible in Windows Explorer in c:\Windows\Assembly. I don't know why that is, and it comes back to haunt me, as you will see.

    Now I need to deploy to the test server, running Windows Server 2003 R2.  (The production server is running 2008, but I will cross that bridge when I get there.)  Imagine my amazement when gacutil does not work properly on the server, despite several forum posts suggesting otherwise.

    I copied gactutil.exe and the related config to c:\windows\Microsoft.NET\Framework\v4.0.30319.  It runs, and displays the version, but nothing else.  "gacutil /?" does not display the list of help, only the version.  There is no error msg of any sort.

    Note that I opened the Command prompt using Run as... Administrator with "Restricted Access" unchecked.

    I also tried simple Drag&Drop of the DLL into thre GAC, but that also had no effect.

    So after reading many forum posts, I decided to make a Windows Installer project for my GAC assembly.  I added a Setup Project to the Solution.  I added a "Global Assembly Cache Folder" Special Folder to the project, and added Primary output from the original project.  Inspecting the Primary Output, I verify it is the correct DLL in the correct location.  I build everything and it does create a reasonable looking .msi file.

    I ran the msi on my dev machine after first removing the DLL from the GAC, and it was properly reinstalled.

    I FTP the msi over to the server and install it.  I tried both double clicking and using msiexec from the command line.  Both ran well, successfully completed, and looked correct.  But the DLL is nowhere to be found in the GAC.

    It is not visible in Windows Explorer, but then it also wasn't visible on my dev machine.  And gacutil still does not show anything!

    How do I debug this?  Is there anyway to run gacutil or some equivalent on Server 2003? 

    Thanks.

    --d

    Tuesday, April 9, 2013 12:20 PM

Answers

  • User-166373564 posted

    Hi,

    As we know, the Global Assembly Cache tool allows us to view and manipulate the contents of the global assembly cache and download cache. This gives a detailed information about using Global Assembly Cache Tool (Gacutil.exe) in MSDN library, I think it will helpful for you to use it better,

    hope it helpful to you,

    With regards<!--?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" /--><o:p></o:p>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 15, 2013 5:10 AM

All replies

  • User1536948012 posted

    It occurred to me that the problem might lie with Remote Desktop access to the server. Fortunately, this test server physically resides on site, so I was able to try the steps while sitting at the actual machine.  Still did not work.

    Wednesday, April 10, 2013 9:13 AM
  • User1536948012 posted

    Making progress.  gacutil is still not functional for viewing assemblies on the server, but at least I found where the msi (and maybe gacutil) installed the assembly.

    It turns out there is another location for assemblies in the GAC in addition to c:\Windows\Assembly.  It is:

    c:\windows\Microsoft.NET\assembly\GAC_MSIL\MyCommonCode\v4.0_1.0.21.0_549...\MyCommonCode.dll

    In the above folder name, "v40" is the Framework version, "1.0.21.0" is the AssemblyVersion, and "549..." is the public key token.

    Seeing this and realizing that the version of the dll disagreed w/ the version indicated in <add assembly> in web.config, I edited the version number in web.config to "1.0.21.0" and the app loads and tries to run.

    Now I get an error trying to execute a stored procedure on the database, but I will post that under a new thread.

    In the meantime, can anyone explain why gacutil is not showing any assemblies on the server?

    Thanks.

    --Dan

     

     

    Wednesday, April 10, 2013 2:24 PM
  • User-166373564 posted

    Hi,

    As we know, the Global Assembly Cache tool allows us to view and manipulate the contents of the global assembly cache and download cache. This gives a detailed information about using Global Assembly Cache Tool (Gacutil.exe) in MSDN library, I think it will helpful for you to use it better,

    hope it helpful to you,

    With regards<!--?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" /--><o:p></o:p>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 15, 2013 5:10 AM