title: Web Deploy to Server with MSBuild
body: <p>I have a publish profile set up in a VS 2012 project. When I right click on the project in VS, select Publish and click on the [Publish] button, it publishes the project to the server using the settings provided in the Publish Profile.</p>
  
  <p>When I use msbuild and the command line, with the following syntax:</p>
  
  <pre><code>msbuild.exe .\mvc.csproj /p:PublishProfile=DevServer 
  /p:DeployOnBuild=True /p:Password=MyPassword /p:AllowUntrustedCertificate=true
  </code></pre>
  
  <p>Then it builds the project, and gives me a message:</p>
  
  <blockquote>
    <p>Package "mvc.zip" is successfully created as a single file at the following location: file:///c:/code/mvcsite/obj/Debug/Package</p>
  </blockquote>
  
  <p>And then provides info on how to deploy the package.</p>
  
  <p>How can I deploy from the command line? My ultimate goal is to run the deployment through TeamCity, and am right now trying to get my command line properties correct. However, the most that I can do from the command line right now is to create the deployment package, but not to run the actual deployment. How can I do both (preferably with one statement, to duplicate what happens in VS2012 when I deploy from there)?</p>