Thursday, 16 July 2015

Windows: How to Add an assembly to the Global Assembly Cache on Windows Server 2008

While building a SharePoint solution, I encountered an error saying:

"Could not load file or assembly 'CabLib, Version=10.2.0.0, Culture=neutral, PublicKeyToken=5c838b77b53f84a0' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

My operating system is a 32-bit Windows Server 2008 Enterprise.

The 32-bit version of CadLib resides at Program Files\WSP Tools\WSPBuilderExtensions\Resources\x86. This needed to be added to GAC.

Usually a drag and drop of the dll to Windows\Assembly would work. But on my case, it didn't.

So to make the drag and drop work on my version of operating system, here's what I did:
  • Temporarily disable User Account Control: Run all administrators in Admin Approval Mode in Administrative Tools > Local Security Policy > Local Policies > Security Options
  • Restart the server. This is required for the security policy to take effect.
  • Drag and drop the DLL to Windows > Assembly.
  • Enable again the security policy.





Note that the account I used to log in to the machine is a member of the Local Administrators Group.

No comments:

Post a Comment