How to customize publication in ASP.NET?
We deploy our web application with Subversion, and are very happy with it.
The build server compiles the application, copies it to a deploy directory and checks in changes to a Subversion repository. Okay, I admit that this is not trivial, but it's worth to invest here... because on the server(s) the deployment is now extremely easy. Advantages are:
- Only the necessary files are copied to the server, the downtime is minimal (using svn update)
- It's a piece of cake to verify what version is deployed to the server, and it's easy to have a consistent version across multiple web servers
- If you screwed up, it's just 2 clicks to revert back to the previous version
- It's takes care of deleting files when you deploy a new version. Copying a web application over an older version can leave potentially dangerous files
- Modifications in the web.config are not overwritten by the deployment, they are merged. That's really a big plus
You can set pre and post build events, and can have one the events fire a script to complete your tasks.
You might look to see if the IIS Web Deployment Tool fits your scenario; it allows you to publish your website, configuration settings, database, etc... all together. This will also be integrated into Visual Studio 2010.