GAC Folder for SharePoint

What is the GAC Folder?

  • Global Assembly Cache (or simply, GAC)
  • Special folder in Windows designed for storing .NET global DLLs

GAC folder in SharePoint

When developing solutions forthe SharePoint platform, you will often deploy your solutions to GAC folder and use libraries that are already deployed to GAC.

Location

C:\Windows\Microsoft.NET\assemblyin newer versions of .NET Framework (4.0)

When your try to access those paths, you can't simply copy/paste files to that folder or delete files from it. Of course, there is a way of opening GAC as an ordinary folder, but it is not recommended for you to do it because you can accidentally erase DLL that some other application is using.

Commands for GAC Util

  • Register an assembly in GAC -> gacutil.exe /i<entirePath\assemblyName>
  • Remove an assembly from GAC -> gacutil.exe /u <assemblyName>

In SharePoint Farm solutions, every solutions is automatically registered in GAC once deployed using visual studio. Otherwise you are deploying from command prompt.

Instead of updating the SharePoint solution you can add the dll file in GAC util. Steps are following.

Step 1

Go to Start -> All Programs ->Visual Studio 2013 ->Click Visual Studio Tools.



Step 2

Click Developer Command Prompt for VS2013. The following screen will appear.



Step 3

Type the following commands.

Gacutil –if “foldername and path of your dll”.



Press enter.



Step 4

Reset your IIS.



Your changes will be applied.

Summary

In this article we have explored what is GAC folder and the use of GAC folder for SharePoint.

Reference - Sharepoint 1on1.

Ebook Download
View all
Learn
View all