title: MSBuild publish web project from command line does Package instead of FileSystem
body: <p>I have a web project that I am publishing from the command line, using a publish profile that does a few additional tasks (excludes some files and folders, grunt, publishing another project in turn).</p>
  
  <p>One two machines (A and B), it works fine from right-click > Publish... in Visual Studio, and choosing the correct publish profile.</p>
  
  <p>Historically, on both machines, it has also worked with the following command line:</p>
  
  <pre><code>msbuild MyProject.csproj /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=myProfile  /v:n
  </code></pre>
  
  <p>However now, machine B is not publishing correctly.</p>
  
  <p>The publish profile is configured with <code>&lt;WebPublishMethod&gt;FileSystem&lt;/WebPublishMethod</code> at the top, however from the logs, it is attempting a <code>Package</code> publish type instead, for no apparent reason.</p>
  
  <p>Here is the full publish profile:</p>
  
  <pre><code>&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;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;False&lt;/ExcludeApp_Data&gt;
          &lt;publishUrl&gt;..\Production&lt;/publishUrl&gt;
          &lt;DeleteExistingFiles&gt;False&lt;/DeleteExistingFiles&gt;
          &lt;ExcludeFoldersFromDeployment&gt;Content;Scripts;Pages&lt;/ExcludeFoldersFromDeployment&gt;
          &lt;ExcludeFilesFromDeployment&gt;index-dev.html;index.html;debug.html;JSLintNet.json;Gruntfile.js;package.json;packages.config;publishall.bat;publishapi.bat&lt;/ExcludeFilesFromDeployment&gt;
          &lt;BuildDependsOn&gt;
              $(BuildDependsOn);
              RunGrunt;
              PublishApi;
          &lt;/BuildDependsOn&gt;
      &lt;/PropertyGroup&gt;
      &lt;Target Name="RunGrunt"&gt;
          &lt;Message Text="Running grunt production..." /&gt;
          &lt;Exec Command="grunt production" /&gt;
      &lt;/Target&gt;
      &lt;Target Name="PublishApi"&gt;
          &lt;Message Text="Publishing API..." /&gt;
          &lt;Exec Command="publishapi" /&gt;
      &lt;/Target&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>As you'd expect, because it is just doing a <code>Package</code>, no files ever appear in the <code>publishUrl</code> directory. Again, the publish profile works fine from VS2013, using right-click publish.</p>
  
  <p>In the log on machine A I get this excerpt:</p>
  
  <pre class="lang-none prettyprint-override"><code>**ValidatePublishProfileSettings**:
    Validating PublishProfile(myProfile) settings.
  </code></pre>
  
  <p>But in machine B it doesn't appear.</p>
  
  <p>Later in the log on machine A it contains:</p>
  
  <pre class="lang-none prettyprint-override"><code>**WebFileSystemPublish**:
    Creating directory "..\Production".
    Copying obj\Release\Package\PackageTmp\cache.manifest to C:\SVN\Trunk\src\Web Sites\MyProject\..\Production\cache.manifest.
    Copying obj\Release\Package\PackageTmp\Global.asax to C:\SVN\Trunk\src\Web Sites\MyProject\..\Production\Global.asax.
    Copying obj\Release\Package\PackageTmp\Web.config to C:\SVN\Trunk\src\Web Sites\MyProject\..\Production\Web.config.
    Copying obj\Release\Package\PackageTmp\bin\MyProject.dll to C:\SVN\Trunk\src\Web Sites\MyProject\..\Production\Blithe.Web.Collect.dll.
  </code></pre>
  
  <p>but later in the log on machine B, in place of the above, it contains:</p>
  
  <pre class="lang-none prettyprint-override"><code>**Package**:   
    Invoking Web Deploy to generate the package with the following settings:   
    $(LocalIisVersion) is 7  
    $(DestinationIisVersion) is 7   
    $(UseIis) is True   
    $(IisUrl) is &lt;&lt;&lt;some url&gt;&gt;&gt;  
    $(IncludeIisSettings) is False  
    $(_DeploymentUseIis) is False   
    $(DestinationUseIis) is False
  </code></pre>
  
  <p>The only difference I can think of between the two machines, is that I installed an update on machine B (the problem machine) for 'Windows Azure SDK for .NET (VS2013) - 2.3'. Any ideas how and why this might have broken it?</p>
  
  <p>I tried adding <code>/p:PublishProfileRootFolder="Properties\PublishProfiles"</code> as mentioned <a href="//stackoverflow.com/a/21396873/1061602" rel="nofollow">here</a> but this didn't work.</p>