XCopy不会在Visual Studio中复制 [英] XCopy will not copy in visual studio

查看:157
本文介绍了XCopy不会在Visual Studio中复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将通过Visual Studio的发布后事件将一个exe复制到另一个文件夹中.每次构建都应该发生这种情况.我没有任何错误,exe输出位于自定义文件夹中,但不会复制到另一个文件夹中,为什么? Visual Studio的生成输出仅为:Build successfully. 0 files copied. 使用此脚本,我更改了输出文件夹:$(SolutionDir)..\..\build\$(ProjectName)\.然后,我将尝试将结果复制到另一个文件夹:xcopy "$(SolutionDir)..\..\build\$(ProjectName)\$(TargetFileName)" "$(SolutionDir)..\..\bin\AutoCopy-Server.exe*".我说的最后是"*",这是文件还是目录都没有关系.怎么了我的输出文件夹中的文件已成功复制".看来,xcopy找不到文件,但是没有任何错误.有人有主意吗?

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:

这篇关于XCopy不会在Visual Studio中复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆