Friday, March 27, 2009

Adding Assemblies to the GAC

While working with SharePoint I've found the following approaches (choose any one of the following) for adding assemblies to the GAC. A full explanation for all of the gacutil switches can be found in the Microsoft MSDN Library at http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx. Note that these are for a single-server farm scenario running Windows Server 2003 R2.
  • If Visual Studio .NET (any version) is installed, Start > All Programs > Microsoft Visual Studio [version] > Visual Studio Tools > Visual Studio [version] Command Prompt. From the command prompt navigate to the folder where the assembly to be added to the GAC resides and enter the following...

gacutil.exe -if "[assembly name]"

  • From a raw Command Prompt navigate to the location of the gacutil.exe program (C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server\) and enter the following...

gacutil.exe -if "[assembly file path & name]"

  • Log onto the SharePoint server as an administrator and using Windows Explorer copy the assembly to be added to the GAC into C:\WINDOWS\assembly. Do this by dragging the assembly from the bin folder of your VS project into the C:\Windows\assembly folder.

No comments: