Ben
Ben

Reputation: 5705

How do you 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?

UPDATE 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.

Upvotes: 6

Views: 22680

Answers (3)

Akbar Badhusha
Akbar Badhusha

Reputation: 2627

Might this one help

  1. Change Solution Configuration to Release mode (by default it may be debug)
  2. Click on Solution Explorer and Rebuld the library project.

This will release the dlls to [yourProjectFolder]\bin\Release

Upvotes: 1

ajg
ajg

Reputation: 1753

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.

Upvotes: 7

Matías Fidemraizer
Matías Fidemraizer

Reputation: 64923

You need to customize how deployment process collects files you want to include in your deployment package.

Since your question is about Visual Studio 2010, I've found a Q&A here in StackOverflow that will guide you to the right direction in terms of including additional files (like your class library assemblies) as part of your deployment:

Upvotes: 0

Related Questions