title: Invoke a publish from msbuild for visual studio 2012
body: <p>For VS2010 and before I was utilizing Web Deployment Projects (WDP) to help package my website for production deployment.  I had a MSBuild script that compiled the solution in release mode.  An output of that was production ready website files compiled and cleaned by the WDP.</p>
  
  <p>I see for 2012 WDP have been removed, and a new tab has been created in the properties for the web application.  The options are the same, but now the invocation of this is done via the Publish option (before you just compiled in release mode).</p>
  
  <p>So the question is this.  From an MSBuild script, how do I invoke a Publish operation?  I found some old posts that...</p>
  
  <pre><code>msbuild /target:publish
  </code></pre>
  
  <p>would do the trick.  But that doesn't seem to work in 2012.</p>
  
  <p>Also, I tried in my msbuild task...</p>
  
  <pre><code>&lt;MSBuild Properties="Configuration=Publish;" 
           StopOnFirstFailure="true" 
           Projects="$(BuildDirectory)\MySolution.sln"&gt;&lt;/MSBuild&gt;
  </code></pre>
  
  <p>...but <code>msbuild</code> just reported "unknown configuration".</p>
  
  <p>How can I have <code>msbuild</code> run the publish option from the command line?</p>