Recently I have been working on a Sharepoint 2010  and I had created a Class Library project that will contain some classes and methods. One of the custom webparts I had created was calling a method from one of the class, but when I press F5 to deploy and test my web part I got an error and my assembly file was missing in Sharepoint. I realised that my Class Library assembly file was not deployed. 

Below is a simple step by step instruction on how to include a assembly file in your Sharepoint package.

For example here I have a solution with a Sharepoint 2010 and a class library project. In the Sharepoint 2010 project there is a package folder containing a file called Package.package

visual studio 2010 solution

Sharepoint deployment package

Double click on this file will bring up the package screen and at the botton of this screen there is an Advanced button. 

Sharepoint deployment package advanced button

On the next screen you can Add assembly files, I am going to include my Class Library project assembly file by select the Add Assembly from Project Output. But if you wish to add an external assembly file you select Add Existing Assembly instead.

In the Add Assembly from Project Output window select from a list of existing assembly files from your solution to be included in the package. You can set the deployment target to either GAC or WebApplication

Next time when a Sharepoint project is deployed the class library assembly file will be included as part of the deployment process.