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?
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