Thursday, 11 July 2013

Packaging a Helper Class with your Project

So you’ve created a helper class library for your SharePoint project, and you’ve gotten the lovely error:
Error occurred in deployment step 'Activate Features': Could not load file or assembly 'AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=Token' or one of its dependencies. The system cannot find the file specified.
What you need to do is package the helper assemble (the project) with your SharePoint Project, to do this you need two things:
  • A SharePoint Project
  • A Class Library project


Your Solution Explorer should look something like this:

Expand your SharePoint Project and double click on the package

Scroll down to the very bottom and click the advanced button.

This will open up the additional assemblies screen. Single click the Add button and Select the “Add Assembly from Project Output” option to bring up the associated window

Select your project from the source Project: drop down

Hit ok, and you’re done.