title: gulp task runner msbuild fails, but works in cmd
body: <p>I have a project where Gulp task runner is setup. Everything works perfectly fine in VS2015, but when I upgraded to VS2017 MSBuild started to fail.</p>
  
  <p>The funny thing is, that if I copy out the command line that apparently fails and paste it into the cmd, then it works perfectly fine.</p>
  
  <p>I get the following error:</p>
  
  <pre><code>[09:47:27] Building project: ..\DFS.Client\DFS.Client.csproj
  [09:47:27] Using automatic maxcpucount
  [09:47:27] Building project: 1 item
  [09:47:27] { Error: Command failed: "C:\Program Files 
  (x86)\MSBuild\14.0\Bin\MSBuild.exe" 
  "C:\solutions\dfs\code\DFS.Client\DFS.Client.csproj" "/target:Clean;Build" 
  /verbosity:minimal /toolsversion:14.0 /nologo /maxcpucount 
  /property:Configuration="Debug" /property:DeployOnBuild="true" 
  /property:DeployDefaultTarget="WebPublish" 
  /property:WebPublishMethod="FileSystem" 
  /property:DeleteExistingFiles="false" 
  /property:publishUrl="C:\inetpub\wwwroot\dfsdev\Website" 
  /property:_FindDependencies="true"
     at ChildProcess.exithandler (child_process.js:204:12)
     at emitTwo (events.js:106:13)
     at ChildProcess.emit (events.js:191:7)
     at maybeClose (internal/child_process.js:891:16)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: '"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe" 
  "C:\\solutions\\dfs\\code\\DFS.Client\\DFS.Client.csproj" 
  "/target:Clean;Build" /verbosity:minimal /toolsversion:14.0 /nologo 
  /maxcpucount /property:Configuration="Debug" /property:DeployOnBuild="true" 
  /property:DeployDefaultTarget="WebPublish" 
  /property:WebPublishMethod="FileSystem" 
  /property:DeleteExistingFiles="false" 
  /property:publishUrl="C:\\inetpub\\wwwroot\\dfsdev\\Website" 
  /property:_FindDependencies="true"' }
  [09:47:27] Build failed!
  </code></pre>
  
  <p>If I copy the command line that is stated as failing and run it in CMD it works. I have tried the following <a href="https://stackoverflow.com/questions/35889975/gulp-task-failing-when-run-from-vs-2015-task-runner-explorer-but-not-from-comma">fix</a> without any luck.</p>
  
  <p>The gulp task that fails looks like this:</p>
  
  <pre><code>var publishProjects = function (location, dest) {
  dest = dest || config.websiteRoot;
  var targets = ["Build"];
  if (config.runCleanBuilds) {
      targets = ["Clean", "Build"];
  }
  console.log("publish to " + dest + " folder");
  return gulp.src([location + "/**/*.csproj"])
    .pipe(foreach(function (stream, file) {
        return stream
          .pipe(debug({ title: "Building project:" }))
          .pipe(msbuild({
              targets: targets,
              configuration: config.buildConfiguration,
              logCommand: false,
              verbosity: "minimal",
              maxcpucount: 0,
              toolsVersion: 14.0,
              properties: {
                  DeployOnBuild: "true",
                  DeployDefaultTarget: "WebPublish",
                  WebPublishMethod: "FileSystem",
                  DeleteExistingFiles: "false",
                  publishUrl: dest,
                  _FindDependencies: "true"
              }
          }));
    }));
  };
  </code></pre>
  
  <p>Help would be appreciated as I would really like to use VS2017 rather than 2015.</p>