title: Using a publish profile with msbuild
body: <p>I'm trying to use a publish profile with the <code>msbuild</code> command in a PowerShell window on a machine that does not have the full Visual Studio IDE installed. I have tried the following:</p>
  
  <pre><code>msbuild.exe .\Web.Admin.csproj /p:'DeployOnBuild=true;PublishProfile=Default;'
  MSBuild.exe .\Web.Admin.csproj /p:PublishProfile=Default /p:VisualStudioVersion=14.0
  msbuild.exe .\Web.Admin.csproj /p:PublishProfileRootFolder=C:\Users\username\Projects\Web\Web.Admin\Properties\PublishProfiles  /p:PublishProfile=Default
  </code></pre>
  
  <p>In both cases, the publish profile seems to be ignored. This is the publish profile, generated by Visual Studio (in <code>Properties\PublishProfiles\Default.pubxml</code>):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!--
  This file is used by the publish/package process of your Web project. You can customize the behavior of this process
  by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
  --&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup&gt;
      &lt;WebPublishMethod&gt;FileSystem&lt;/WebPublishMethod&gt;
      &lt;PublishProvider&gt;FileSystem&lt;/PublishProvider&gt;
      &lt;LastUsedBuildConfiguration&gt;Release&lt;/LastUsedBuildConfiguration&gt;
      &lt;LastUsedPlatform&gt;Any CPU&lt;/LastUsedPlatform&gt;
      &lt;SiteUrlToLaunchAfterPublish /&gt;
      &lt;LaunchSiteAfterPublish&gt;True&lt;/LaunchSiteAfterPublish&gt;
      &lt;ExcludeApp_Data&gt;True&lt;/ExcludeApp_Data&gt;
      &lt;publishUrl&gt;C:\Sites\Test&lt;/publishUrl&gt;
      &lt;DeleteExistingFiles&gt;True&lt;/DeleteExistingFiles&gt;
      &lt;PrecompileBeforePublish&gt;True&lt;/PrecompileBeforePublish&gt;
      &lt;EnableUpdateable&gt;True&lt;/EnableUpdateable&gt;
      &lt;DebugSymbols&gt;False&lt;/DebugSymbols&gt;
      &lt;WDPMergeOption&gt;DonotMerge&lt;/WDPMergeOption&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>The files are not published to the <code>C:\Sites\Test</code> directory specified, as they would be if I ran this with the <strong>Publish</strong> command in Visual Studio 2017. Instead they go to the project <code>bin</code> directory.</p>
  
  <p>MSBuild Version: 14.0.23107.0</p>