本文介绍了在构建后的xcopy事件中,SolutionDir设置为* Undefined *的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个项目,该项目的生成后事件会将DLL复制到某个目录:
I have a project that has a post-build event that xcopies a DLLs to a certain directory:
xcopy "$(TargetDir)$(TargetName).dll" "$(SolutionDir)..\UdpLocationService\bin\Plugins\" /d /y
xcopy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)..\UdpLocationService\bin\Plugins\" /d /y
但是,由于以下xcopy生成后事件,我将CruiseControl.NET设置为生成服务器,并且MSBuild无法生成该项目:
However, I have CruiseControl.NET set up as a build server and MSBuild is failing on building that project due to this xcopy post-build event:
MSB3073: The command "xcopy "C:\Build\Services\Windows\VehicleServer\Plugins\Payload\bin\Debug\Payload.dll" "*Undefined*..\UdpLocationService\bin\Plugins\" /d /y xcopy "C:\Build\Services\Windows\VehicleServer\Plugins\Payload\bin\Debug\Payload.pdb" "*Undefined*..\UdpLocationService\bin\Plugins\" /d /y" exited with code 4. in Microsoft.Common.targets(3397, 13)
有什么建议可以解决此问题吗?
Any suggestions to get this fixed?
推荐答案
请按照以下步骤操作:
- 卸载项目文件(例如* .csproj)
- 打开您的项目文件进行编辑
- 找到AfterBuild目标
- 将XCopy的两个调用分离为两个不同的Exec任务
- 保存更改并重新加载项目文件
这篇关于在构建后的xcopy事件中,SolutionDir设置为* Undefined *的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!