我正在尝试在 Visual Studio 2008 中构建一个 Web 部署项目,但它一直失败,我不知道为什么。错误:
------ 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 ==========
我在另一台机器上有相同的项目,它构建得很好。我已经下载了Visual Studio 2008 Web 部署项目 - RTW并安装了 Visual Studio 2008 的 Service Pack 1。
编辑:
在错误列表中,它具有Error 1 The command "if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"" exited with code 1.
. 我不知道为什么会出现,C:\Documents
因为项目位于没有空格的文件夹中(C:\Web\Projects\
)
它发生在一个全新的 Web 部署项目中,该项目是通过右键单击网站并单击创建的Add Web Deployment Project
。
编辑(1 月 29 日)。更详细的输出,每当<exec>
使用 with时都会失败if exist
:
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