Last post Apr 15, 2013 05:10 AM by Angie xu - MSFT
Apr 09, 2013 12:20 PM|dhurwitz|LINK
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?
Apr 10, 2013 09:13 AM|dhurwitz|LINK
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.
Apr 10, 2013 02:24 PM|dhurwitz|LINK
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:
In the above folder name, "v40" is the Framework version, "18.104.22.168" 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 "22.214.171.124" 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?
Apr 15, 2013 05:10 AM|Angie xu - MSFT|LINK
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,