Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a post-build event to a web site in Visual Studio 2008

I am using a "web site" in visual studio 2008, and i would like to add a post-build event which would append the build time to the web.config file. Is it possible?

like image 688
PBG Avatar asked Apr 06 '09 14:04

PBG


3 Answers

  1. Add a separate (empty) project (".buildstep"), to which you add your custom build step - you'll have to specify target folders to the main web project, but make use of the predefined environment variables (like $solutiondir, $platform, $mode etc).
  2. Add a dependency to this new project from the main web project (Project | Project Dependencies).
  3. Rebuild + verify build step has been carried out. You're done.
  4. ;o)
like image 188
Mosca Pt Avatar answered Nov 08 '22 22:11

Mosca Pt


One of the major benefits of going the WAP (Web Application Projects) route rather than WSP (Website Projects) is that you get the ability to have Post Build events.

Therefore, it is not possible out of the box anyway. Here is the detail.

like image 25
Mitchel Sellers Avatar answered Nov 08 '22 22:11

Mitchel Sellers


I'm afraid this isn't supported for web sites, you'll need to use a web application project.

like image 31
Steve Avatar answered Nov 08 '22 22:11

Steve