Deploying referenced assemblies with your VS2010 SharePoint 2010 WSP solution

Here is the scenario: you have SharePoint 2010 solution created with Visual Studio 2010, if you’re creating a sandbox or test project in it – easy enough Visual Studio will take care of the deployment for you. As soon as your solution gets more complicated and you decide to separate some common logic to other layers (Service layer for instance) you will notice that SharePoint won’t include your separate project assembly to GAC (even if you sing it, add to references).

Here is how to get your helper assemblies deployed to GAC with one of your SharePoint 2010 WSPs:

1. I assume you have already created a project in your solution that produces DLL as an output and you have signed it

2. Reference the new helper project in your SharePoint 2010 project

including external assemblies

3. If you have few SharePoint 2010 projects in your solution pick any of them and open Package.package

4. On the bottom of the default Package UI click Advanced advanced package options

5. From here you can include as many assemblies as you need in your WSP package. If those are part of the project – select an option to include existing project output

select from project output

That’s it – when you build and package your solution again - the DLL will be included as a part  of your package. Good luck!

This entry was posted in sharepoint, sharepoint 2010 and tagged , , , . Bookmark the permalink.

Comments are closed.