Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Web Application Build Output - How do I include all deployment files?

When I build my ASP.NET web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as the result of each build? Trying to pick the right files out of the source directory is a pain.

The end result should be xcopy deployable.

Update: I don't want to have to manually use the Publish command which I'm aware of. I want the full set of files required by the application to be the build output - this means I also get the full set of files in one place from running MSBuild.

like image 524
Simon Steele Avatar asked Dec 31 '22 11:12

Simon Steele


1 Answers

One solution appears to be Web Deployment Projects (WDPs), an add-on for Visual Studio (and msbuild) available that builds a web project to a directory and can optionally merge assemblies and alter the web.config file. The output of building a WDP is all the files necessary to deploy the site in one directory.

More information about Web Deployment Projects:

  1. Announcement on webdevtools MSDN blog for WDP 2008
  2. ScottGu introduction to WDP 2005

The only disadvantage to this solution is the requirement on an add-on which must be available on the build machine. Still, it's good enough for now!

like image 57
Simon Steele Avatar answered Jan 01 '23 23:01

Simon Steele