2010-01-26 134 views
1

我试图在Visual Studio 2008中构建一个Web部署项目,它保持失败,我不知道为什么。错误:Web部署项目失败构建(Visual Studio 2008)

------ 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 Deployment Projects - RTW和安装Service Pack 1的Visual Studio 2008

编辑:

在错误列表,它有Error 1 The command "if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"" exited with code 1.。我不知道为什么它是未来与C:\Documents作为该项目的文件夹中没有空格(C:\Web\Projects\

它发生了一个全新的网络部署项目,通过右键点击该网站,点击Add Web Deployment Project上创建的。

编辑(1月29日)。更详细的输出,failes每当<exec>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 
+1

看起来像它不喜欢在您的C:\ Documents and Settings – RYFN 2010-01-26 15:43:30

+0

空间C:\ Documents没有被引用到解决方案或项目文件中的任何地方 – SamWM 2010-01-26 17:05:48

回答

1

找出问题所在。

用户配置文件夹中它有一个@符号,它看起来像它可能会破坏的MSBuild(因为@具有特殊意义的MSBuild)。

用户配置文件文件夹是C:\Documents and Settings\[email protected],将其重命名为C:\Documents and Settings\username修复了我遇到的这个问题。所以文件夹名称中有空格不是失败的原因。

1

我认为你的项目建立到一个临时目录,之后它被复制到一个更加永久的位置。 ".\TempBuildDir\"是一个相对路径,它可能会导致pc上的非间距目录生成成功,但由于临时目录的位置(默认位于C:\ Documents and Settings)而在您的PC上失败。

只是要确定:检查您的电脑和其他机器上的临时目录的位置。或者,如果可能的话,将TempBuildDir路径更改为更类似于C:\ Temp或任何适合您的东西。

更具体地讲:如果其他机器是Vista或Win7的电脑,在TempBuildDir可能在℃以内的某个位置:\ Users目录中。如果您的机器是WinXP电脑,TempBuildDir很可能位于C:\ Documents and Settings中的某处。

相关问题