title: Web Deployment Project failing build (Visual Studio 2008)
body: <p>I am trying to build a Web Deployment Project in Visual Studio 2008 and it keeps failing and I am not sure why. Error:</p>
  
  <pre><code>------ Build started: Project: website_deploy, Configuration: Release Any CPU ------
  if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
  'C:\Documents' is not recognized as an internal or external command,
  operable program or batch file.
  C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(92,7): error MSB3073: The command "if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"" exited with code 1.
  Done building project "website_deploy.wdproj" -- FAILED.
  ========== Build: 1 succeeded or up-to-date, 1 failed, 0 skipped ==========
  </code></pre>
  
  <p>I have the same project on another machine and it builds just fine. I have downloaded <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&amp;displaylang=en" rel="nofollow noreferrer">Visual Studio 2008 Web Deployment Projects - RTW</a> and installed Service Pack 1 for Visual Studio 2008.</p>
  
  <p>Edit:</p>
  
  <p>In the error list, it has <code>Error 1 The command "if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"" exited with code 1.</code>. I don't know why it is coming up with <code>C:\Documents</code> as the project is in a folder without spaces (<code>C:\Web\Projects\</code>)</p>
  
  <p>It happens with a brand new web deployment project, created by right-clicking on the website and clicking <code>Add Web Deployment Project</code>.</p>
  
  <p>Edit (29 Jan). More verbose output, failes whenever <code>&lt;exec&gt;</code> with <code>if exist</code> is used:</p>
  
  <pre><code>Building with tools version "3.5".
  Target "_PrepareForBuild" in file "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets":
    Using "CreateProperty" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    Task "CreateProperty"
    Done executing task "CreateProperty".
    Task "CreateProperty"
    Done executing task "CreateProperty".
    Task "CreateProperty"
    Done executing task "CreateProperty".
    Using "Exec" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    Task "Exec"
      Command:
      if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
      'C:\Documents' is not recognized as an internal or external command,
      operable program or batch file.
      C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(92,7): error MSB3073: The command "if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"" exited with code 1.
    Done executing task "Exec" -- FAILED.
  Done building target "_PrepareForBuild" in project "website_deploy.wdproj" -- FAILED
  </code></pre>