title: MSBuild: $(WebPublishMethod) does not have a valid value
body: <p>Im trying to publish one of our web-projects with MSBuild. When I do it directly through VS 2017 it works fine but when I run MSBuild it fails.</p>
  
  <p>MS Build command:</p>
  
  <pre><code>"C:\ProgramFiles(x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild" MySolution.sln /p:DeployOnbuild=true /p:Configuration=Release /p:PublishProfile=Properties/PublishProfiles/publish.pubxml
  </code></pre>
  
  <p>Results in the following error </p>
  
  <blockquote>
    <p>C:\Program Files (x86)\Microsoft Visual
    Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(4359,
    4): PublishProfile(publish.pubxml) is set. But the $(WebPublishMethod)
    does not have a valid value.  Current Value is "FileSystem".</p>
  </blockquote>
  
  <p>My <code>publish.pubxml</code> file looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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;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;\\1.1.1.1\c$\Site\mysite.se&lt;/publishUrl&gt;
           &lt;DeleteExistingFiles&gt;True&lt;/DeleteExistingFiles&gt;
  
  &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>What do I do wrong?</p>