当 Visual Studio 告诉我“xcopy exited with code 4"时出了什么问题? [英] What is going wrong when Visual Studio tells me "xcopy exited with code 4"

查看:57
本文介绍了当 Visual Studio 告诉我“xcopy exited with code 4"时出了什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对构建后事件不是很熟悉,所以我对我的程序出了什么问题有点困惑.在 Visual Studio 2010 中编译时,我得到以下信息:

I'm not very familiar with post-build events, so I'm a little confused as to what's going wrong with my program. When compiling in visual studio 2010, I get the following:

The command "xcopy C:UsersMePathFoo.barLibrarydsoframer.ocx C:UsersMePathFoo.barinDebug /Y /E /D
xcopy C:UsersMePathFoo.barApplicationFiles C:UsersMePathFoo.barinDebug /Y /E /D
xcopy C:UsersMePathurl C:UsersMePathFoo.barinDebug /Y /E /D
rmdir /S /Q C:UsersMePathFoo.barinDebug.gwt-tmp" exited with code 4.    

程序似乎运行良好,尽管有这个错误,但我不想忽略这个问题,希望不会发生任何不好的事情.奇怪的是,这一行开始时只有一个命令(第一个 xcopy),但随着我继续编译项目(修复其他问题,主要是引用),错误消息越来越大.知道会发生什么吗?

The program appears to run fine, despite this error, but I don't want to just ignore this issue and hope nothing bad happens. Strangely, this line started out as only a single command (the first xcopy) but as I continued to compile the project (fixing other problems, mostly references) the error message expanded larger and larger. Any idea what could be going on?

以下是似乎失败的构建后事件 --

Here are the postbuild events that seem to be failing --

xcopy $(ProjectDir)Librarydsoframer.ocx $(TargetDir) /Y /E /D
xcopy $(ProjectDir)ApplicationFiles $(TargetDir) /Y /E /D
xcopy $(SolutionDir)com.myUrl.gwtwww $(TargetDir) /Y /E /D
rmdir /S /Q $(TargetDir).gwt-tmp

推荐答案

Xcopy 退出代码 4 表示发生初始化错误.没有足够的内存或磁盘空间,或者您输入了无效的驱动器名称或无效的语法命令行."

Xcopy exit code 4 means "Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line."

看起来 Visual Studio 正在向 xcopy 提供无效参数.通过 Project > 检查您的构建后事件命令右键单击 >属性 >构建事件 >发布构建事件.

It looks like Visual Studio is supplying invalid arguments to xcopy. Check your post-build event command via Project > Right Click > Properties > Build Events > Post Build Event.

请注意,如果 $(ProjectDir) 或类似的宏术语在展开时在结果路径中有空格,则它们需要用双引号括起来.例如:

Note that if the $(ProjectDir) or similar macro terms have spaces in the resulting paths when expanded, then they will need to be wrapped in double quotes. For example:

xcopy "$(ProjectDir)Librarydsoframer.ocx" "$(TargetDir)" /Y /E /D1

这篇关于当 Visual Studio 告诉我“xcopy exited with code 4"时出了什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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