Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically publish a website on build in Visual Studio 2008?

I want to be able to automatically publish to a local folder each time a web asp.net mvc 2 project is built.

I use Visual Studio 2008.

like image 585
Rohit Avatar asked Feb 14 '10 19:02

Rohit


People also ask

How do I publish my website in Visual Studio?

On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish. If you have previously configured any publishing profiles, the Publish pane appears. Click New or Create new profile. Select the option to import a profile.

What is the difference between Build and publish in Visual Studio?

Build compiles the source code into a (hopefully) runnable application. Publish takes the results of the build, along with any needed third-party libraries and puts it somewhere for other people to run it.


2 Answers

Well you could do it with MSBuild in a post-build event.

But are you sure you want to do this? It will slow you down, and you probably don't need to publish for every build? Why not just run the site in IIS instead of Cassini.

like image 131
Luhmann Avatar answered Oct 08 '22 07:10

Luhmann


Step 1. Make sure that you have a web project.

Step 2. Go to View->Toolbars->Web One Click Publish.

The publish button web button on the toolbar will do what you want... build and publish in one step.

like image 7
Daeron Avatar answered Oct 08 '22 08:10

Daeron