How to set up publishing in ASP.NET?

I am working on a fairly new project, and we started from scratch. Thus, it is necessary to develop not only a web application, but also the entire process of publishing a site and setting up a web server, etc., in order to do this from scratch.

This question may be more appropriate for serverfault, but it really depends on the answers. So let's try it.

Wehn ever published our site via VS2008 (right click on the website, publish the website, wait ... do it) I need to somehow configure the process and start some other tasks, for example: - Copy some folders from my dav machine to the web server - Delete the test database and let some scripts run on it - and maybe a little more I don’t remember right now.

I read about the most obvious solutions, such as MSBuild, Powershell, and VSTS2008, but I really don't want to dive deep into them until I really know that these tools can really solve my problems. So guys, I’m sure many of you know a lot about these tools or even better ones. Please let me know. I really appreciate it.

Here is my environment in which I live: - VS 2008 - VSTS 2008 - SQL Server 2008 - Windows Server 2008

UPDATE: Thank you for the excellent answers so far, but I am especially looking for a solution integrated into the Visual Studio Team Foundation Server, since we are already using it for Source Control.

Cheers, Steve

+7
powershell publishing msbuild
source share
3 answers

You can set pre and post build events, and can have one of the events that run the script to complete your tasks.

+2
source share

We are deploying our web application using Subversion and are very pleased with it.

The build server compiles the application, copies it to the deployment directory, and checks for changes in the Subversion repository. Well, I admit that this is not trivial, but it is worth investing here ... because deployment on server (s) is now very easy. Benefits:

  • Only necessary files are copied to the server, downtime is minimal (using svn update)
  • This is a piece of cake to check which version is installed on the server, and it is easy to have a consistent version on multiple web servers.
  • If you mess it up, it's just 2 clicks to go back to the previous version.
  • When you deploy a new version, files are deleted. Copying the web application over the old version can leave potentially dangerous files.
  • Changes to the web.config file are not overwritten by the deployment; they are merged. This is a really big plus.
+4
source share

You can see if the IIS Web Deployment Tool is right for your scenario; It allows you to publish your site, configuration settings, database, etc. together. It will also be integrated into Visual Studio 2010.

+1
source share

All Articles