title: WebDeploy with MSBuild Not Deploying from TeamCity
body: <p>I am trying to use MSDeploy to deploy an MVC project to the server using TeamCity. When I do this on my computer in powershell, using the following command:</p>
  
  <pre><code>msbuild.exe .\mvc.csproj /p:PublishProfile=DevServer /p:VisualStudioVersion=11.0
  /p:DeployOnBuild=True /p:Password=MyPassword /p:AllowUntrustedCertificate=true
  </code></pre>
  
  <p>It builds the project and deploys it to the server (info defined in the DevServer publish profile) perfectly. The output shows an <code>MSDeployPublish</code> section at the end, in which I see text like <code>Starting Web deployment task from source...</code> and then with rows telling me what files are updated, etc.</p>
  
  <p>When I run this on TeamCity, using an MSBuild Build step, on the same file, with the same parameters (from the same working directory) it builds the project but does not publish it. Instead it has the regular output from a build process (CoreCompile, _CopyFilesMarkedCopyLocal, GetCopyToOutputDirectoryItems, CopyFilesToOutputDirectory) but then does not actually go and publish anything.</p>
  
  <p>What changes to I need to make to the setup in TeamCity to get it to publish deploy in the same way that it works using MSBuild from my computer? </p>
  
  <p>(TeamCity 7.1, MSBuild 4.0, WebDeploy 3.0, Visual Studio 12, IIS 7. Related to <a href="https://stackoverflow.com/q/14230272/51">my previous question</a>)</p>