Pages

Sunday, 20 January 2013

SharePoint 2010 Cannot add the specified assembly to the GAC



Error: 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.

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:\windows\assembly\temp

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.

5 comments:

  1. Thank you very much, we had a persisting issue that we couldn't resolve. Your help is indeed valued.

    ReplyDelete
  2. It didn't help Us.
    IISRESET + reset SPTIMERV4 + physical restart + SysInternals Handle to remove locking process, delete the file
    Also, cannot put back old version in GAC
    And also, GACUTIL says the file is arleady installed, after uninstall doesn't work either.

    ReplyDelete
  3. you rock - fixed my issue

    ReplyDelete
  4. Visual studio Restart + IISRESET

    ReplyDelete