我想将文件夹从我的Visual Studio 2015项目的根目录复制到输出目录(因为这样会破坏没有它的应用程序),所以我决定将xcopy添加到生成后命令中。
xcopy "$(SolutionDir)Content\*.*" "$(TargetDir)Content\" /s /i /y
运行它时,我会得到以下提示,现在由于xcopy我什至无法测试该应用程序。
1> File not found - *.*
1> 0 File(s) copied
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "xcopy "E:\Data\Projects\Vessel\Games\TheThing\Content\*.*" "E:\Data\Projects\Vessel\Games\TheThing\TheThing\bin\DesktopGL\AnyCPU\Debug\Content\" /s /i /y" exited with code 4.
答案 0 :(得分:1)
我有时还会在Visual Studio中遇到Xcopy和postbuild事件的问题。 我的解决方法通常是创建一个包含xcopy的批处理脚本。
然后通过以下方式调用批处理脚本:
call "$(SolutionDir)scripts\copyfiles.bat"
作为脚本发布事件。