XCopy will not copy in visual studio

元气小坏坏 提交于 2019-12-02 11:34:36

问题


I'll copy a exe into another folder with a post build event from visual studio. This should happens every build. I haven't any errors, the exe output is in a custom folder, but it will not copy into another folder, why? The build output from visual studio is only: Build successfully. 0 files copied. With this script, I've changed the output folder: $(SolutionDir)..\..\build\$(ProjectName)\. And with this, I'll try to copy the result into another folder: xcopy "$(SolutionDir)..\..\build\$(ProjectName)\$(TargetFileName)" "$(SolutionDir)..\..\bin\AutoCopy-Server.exe*". With the "*" at the end, I say, that it is not matter, if this is a file or a directory. What's wrong here? The file in my output folder, is successfully "copied". It seems, that xcopy can't find the file, but there isn't any error. Has someone an idea?


回答1:


It sounds like this xcopy bug. If so, a workaround is to append <NUL: to the end of the xcopy command, eg:

xcopy "$(TargetDir)\*.exe" "$(SolutionDir)\bin\" /S /Y <NUL:


来源:https://stackoverflow.com/questions/28949284/xcopy-will-not-copy-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!