C# – How to publish Class Libraries in Visual Studio


I have a MVC web application that I am developing in Visual Studio 2010. Along side my MVC project in my solution I also have 2 Class Library projects.

When I right click the MVC project in the solution explorer I get (among others) these options: Build Deployment Package, Publish..., and Package/Publish Settings.

These options are not available for the 2 Class Library projects, so prior to uploading any code I am currently putting everything in a deployment folder on my local machine using the Publish... option for the MVC project and just copy & pasting the other 2 projects in windows explorer.

I would very much like to use the Publish... option to deploy all 3 projects using FTP to our server.

I have discovered that if I change the Output Type of the 2 Class Library projects from Class Library to Console Application then I get the options to Publish... etc., but they aren't Console Applicationss so I don't really want to do this.

My question is, how can I , using Visual Studio 2010 publish Class Library projects using FTP?

Turns out I'm a numpty!

Because the MVC app references the 2 class libraries, the .dlls for them are already included in the bin folder for the MVC app and I didn't need to include the other projects when I publish.

Best Solution

You shouldn't need to separately publish the class library projects. When you publish the MVC project it will include any references the project has. As your MVC project references the 2 class library projects, when you publish it the class libraries will be included.