当我使用10个项目构建我的解决方案时,有7个项目构建失败。所有10个项目都有后置构建事件。即使那些使用xcopy命令的项目也是如此。我之所以这样说是因为我的同事认为VS 2012和xcopy并不好用...
这7个构建失败之前没有发生过。
当我尝试构建项目或“偶尔”启动Visual Studio时,会出现以下错误:
我收到了这个错误:
我在SO上搜索了很多,发现这个问题的主要原因似乎是:
这7个构建失败之前没有发生过。
当我尝试构建项目或“偶尔”启动Visual Studio时,会出现以下错误:
我收到了这个错误:
Error 1 The command "xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Client" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\Client\" /s /e /v
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Content" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\Content\" /s /e /v
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Views" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\Views\" /s /e /v
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\web.config" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\"
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\global.asax" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\"
xcopy /y "D:\Replaced\branches\ReplacedTest\Swan.Replaced.Mobile.Web\Tools" "D:\Replaced\branches\ReplacedTest\build\web\bin\..\..\Tools\" /s /e /v
" exited with code 9009. Swan.Replaced.Mobile.Web
我在SO上搜索了很多,发现这个问题的主要原因似乎是:
1.) A whitespace in the path/folder name
2.) The command does not get full paths
3.) Maybe some environment/system variables problem?
我在后期构建事件中没有看到这个错误:
xcopy /y "$(ProjectDir)Client" "$(TargetDir)..\Client\" /s /e /v
xcopy /y "$(ProjectDir)Content" "$(TargetDir)..\Content\" /s /e /v
xcopy /y "$(ProjectDir)Views" "$(TargetDir)..\Views\" /s /e /v
xcopy /y "$(ProjectDir)web.config" "$(TargetDir)..\"
xcopy /y "$(ProjectDir)global.asax" "$(TargetDir)..\"
xcopy /y "$(ProjectDir)Tools" "$(TargetDir)..\..\Tools\" /s /e /v
我的目标目录是这个输出路径:
..\build\web\bin\
我的项目目录是这样的:
D:\Replaced\branches\ReplacedTest
注释:当我在控制台窗口使用xcopy时,完全没有问题。
这是我的配置:
- Windows 7(64位)
- Visual Studio 2012 Premium
我尝试过以下方法来解决问题:
- 重新构建解决方案
- 清理解决方案
- 清除输出路径数据
- 重新启动计算机
- 咬桌面
什么都没用 :/
有人可以帮忙找出错误吗?谢谢!