Tuesday, June 15, 2010

GACUtil missing in Windows Server 2008/Visual Studio 2008

GACUtil missing in Windows Server 2008/Visual Studio 2008

I was developing a webpart in Visual Studio 2008 on Windows Server 2008 to be deployed in a SharePoint Site. While writing the install.bat, I could not configure my post build for my class library in Visual Studio 2008 to be deployed in GAC. The Gacutil was not found at the location – "" I wrote the Gacutil path as I used to do for Visual Studia 2005.

@SET GACUTIL="C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\GacUtil.exe"

And in the Post Build Option

cd $(ProjectDir)
Install.bat

Thus, I had to look for Gacuitl.exe's path. I searched into directories below and I was surprised that it was no where to be found.....

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\GacUtil.exe

C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin // NOT FOUND

C:\Program Files\Microsoft Visual Studio 9.0 // NOT FOUND

C:\Program Files\Microsoft.NET // NOT FOUND

Then I searched into C:\Windows\Microsoft.NET\Framework and found out gacutil.exe.config which was based on .NET 1.1. That was quite old. There was no gacutil.exe in there. However, I was able to run gacuitl from VS2008 command prompt.

Where could the file be? L

Lastly, I found out gacutil was located in -- J

C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin.

This folder contains other assemblies like sn.exe.

The changed Install.bat

REM – Deploying WebPart


 

@SET GACUTIL="C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\GacUtil.exe"


 

Echo Uninstalling the DLL from GAC

%GACUTIL% /u SitePages


 

Echo Installing the DLL in GAC

%GACUTIL% /i "C:\Partha\Devarea\WebPart\bin\Debug\WebPart.dll"


 

Echo Restart IIS Worker Process

Rem IISRESET

Hope this could be handy for others J


 

……. HaPpY CoDinG

Partha (Aurum)


 

No comments:

Post a Comment