Publishing for Web Applications from MSBuild

A search on this topic yields many answers for all the different possible combinations of Visual Studio web projects. Here is another.

Using .Net 3.5 MSBuild.exe take note of the following targets and the custom parameter, WebProjectOutputDir, passed when attempting to publish a web application project.

  • /t:ResolveReferences;_WPPCopyWebApplication
  • /p:WebProjectOutputDir=”c:\\Source\\Build\\My Web App\\” – this is the path to the output directory, all ‘\’ must be replaced with ‘\\’

A complete call will look something like this:

msbuild.exe MyWebApplication.csproj /p:Configuration=Release /t:ResolveReferences;_WPPCopyWebApplication /p:WebProjectOutputDir=”c:\Source\Build\My Web App”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s