SharePoint 2010 Cannot add the specified assembly to the GAC


“Cannot add the specified assembly to the GAC in SharePoint 2010”

We had a solution deployed numerous times as it houses a line of business process in SharePoint 2010. On performing Upgrade Solution via stsadm or Update-Solution via Power Shell , encountered the error: cannot add the specified assembly to the GAC.

We started by created a test solution package and deployed it on the environment which worked fine to identify whether the issue was with the Package or environment.

On updating the LOB Solution , it couldn’t add the assembly to the GAC for LOB WSP, on one of the WFE servers.

Performed an IISRESET and restarted the timer service on the failing WFE, deployed the WSP package again, it did work but when we tried updating it again at the later stage, got the same error.

Solution :

I had to rely on Process Explorer to figure out what process was using the DLL and from where. The beauty of this tool is, it displays the list of processes running on the server and what DLL’s its using.

You can do a Find for the DLL file from the top menu bar to identify the process which it’s using.

I figured out using the Process Explorer, the Timer Service Process was referring to DLL from c:windowsassemblytemp

I cleared the Temp folders which had the DLL, performed an IISRESET and restarted the Timer Service

This resolved the issue for me. You will have to identify what process is conflicting and troubleshoot the same accordingly.


What is a solution package?

  • A solution package is a distribution package that delivers your custom SharePoint Server 2010 development work to the Web servers or the application servers in your server farm. Use solutions to package and deploy custom Features, site definitions, templates, layout pages, Web Parts, cascading style sheets, and assemblies.
  •  You can deploy a Microsoft SharePoint Server 2010 solution directly onto your SharePoint Server farm, or you can deploy the solution into a sandbox. A sandbox is a restricted execution environment that enables programs to access only certain resources, and that keeps problems that occur in the sandbox from affecting the rest of the server environment.
    A solution package is a CAB file with a .wsp file name extension and a manifest file.

  • It is recommended that you use Visual Studio 2010 Tools for SharePoint 2010 to develop and package SharePoint solutions. You can also create solution packages manually by using a tool such as Makecab.exe.
    Components that can be packaged in a solution include:

  • .NET Framework assemblies, typically Web part assemblies and event receiver assemblies.
  • Deployment files such as resource files, pages, or other helper files.
  • Features, which allow you to activate and deactivate code in a Web site and provide functionality that include elements such as custom lists, libraries, fields, and content types.
  • New templates and site definitions.
  • Configurations that must be performed at the Web-server level — for example, deploying customizations to the Web.config files for the registration of Web Parts. You can also modify these configurations with a Feature that is distributed with a Feature.
  • Web content such as Web pages and images that are called by Web pages. If you must deploy Web content in a disconnected environment, you should use a content deployment package.