2

I have a SharePoint 2010 project in a solution, and I have a library project in the solution. In the SharePoint project I've referenced to that project.

Now when I deploy the SharePoint project, my custom library is not being deployed. I checked the GAC and it isn't in there, so I get an error from SharePoint that he cannot load this library etc.

At the references for library I have CopyLocal set to true etc. So how do I deploy this library to GAC?

Second question, can I deploy the library seperatly from deploying SharePoint project? And how to do it?

  • You'll have to manually GAC deploy the dll for your library project. – user2536 Nov 6 '13 at 10:54
4

So, when you reference a dll created in a different project and reference it in your SP project, you need to add it to the Package.

To make Visual Studio adding 3rd party assembly or even your own assembly from other project in solution to GAC please do next:

Open Package.package from Package folder in SharePoint project.

Click Advanced in bottom area.

Click Add and chose which type of assembly you want to add.

In dialog select dll file, chec GAC or BIN, add safe controls and class resources entries if required. Click Ok.

Your assembly will be packaged to WSP, defined in manifest and deployed everytime.

| improve this answer | |
  • Can i ask you another question, what if i do an upgrade of the solution and imaging i changed some code in the custom library and I do an upgrade of the solution, will the new version of the library be put in gac with your approach? – Shkipper Nov 6 '13 at 12:21
  • If you created a new version of the dll, you will need to specify the version in the package manager, but if you just change code in the dll, and not update the version, you dont need to redo the package settings – JP Roelofse Nov 6 '13 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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