I develop an SharePoint 2010 application with VS 2012. This application contains a third party dll that is embedded in the package manifest and deployed to gac. However, every time I deploy the application I receive following error message

Error occurred in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache:

I talked to the vendor of the dll and they told me that a .dat file (that is provided within their package) must be in the same folder as the dll.

This works for "normal" gac deployment (gacutl or copy the dll to gac) but not with the normal SharePoint approach. I simply try to add the .dat file as an assembly reference but then I cant deploy the application because only "real" dlls are allowed in the assembly definition section.

Does anyone know how to integrate a dll that requires a .dat file?


  • Does the assembly have to go in the GAC? i.e. does your solution have dependencies on this third party assembly for timer jobs or service application? You could look to put the assembly against the Web Application
    – Simon Doy
    Jul 31, 2013 at 7:43
  • Yes, unfortunately it has to go into the GAC. Of cause I could write a powerhsell script that deploys the .dll the old way (gacutil) but I like to integrate it into my WSP
    – kicepihifo
    Jul 31, 2013 at 8:26
  • I wonder if you are getting the error for another reason rather than it being because the dat file needs to be there. Do you perform an IIS reset and Restart the SharePoint Timer job before you try the deployment. Are there any other processes which could be locking the assembly.
    – Simon Doy
    Jul 31, 2013 at 8:29
  • I tried the iisreset, owstimer reset and also reboots. I removed the assembly from the GAC by hand (it was not locked). All these steps did not solve the problems. The vendor of the assembly confirmed that the .dat file "must be near" the dll when deploying.
    – kicepihifo
    Jul 31, 2013 at 11:00

1 Answer 1


Step 1: Add the dll to the package as an additional assembly

Step 2: Edit the additional assembly and add the dat file as a class resource

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.