xxx\Microsoft.Common.targets: error MSB3073: The command xxx exited with code 4
来源:互联网 发布:小学生画图软件 编辑:程序博客网 时间:2024/05/18 00:07
http://www.crifan.com/microsoft_common_targets_error_msb3073_command_exited_with_code_4/
在VS2010中编译一个C#项目,结果出错:
PostBuildEvent:
XCOPY /D /Y /R
"D:\tmp\xxx\InsertSkydriveFiles\bin\Debug\crifan.InsertSkydriveFiles.dll"
"C:\Program Files (x86)\Windows Live\Writer\Plugins"
D:\tmp\xxx\InsertSkydriveFiles\bin\Debug\crifan.InsertSkydriveFiles.dll
Sharing violation
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3717,9): error MSB3073: The
command
"XCOPY /D /Y /R "
D:\tmp\tmp_dev_root\wlw\InsertSkydriveFiles_v4.0_2012-04-02-office\InsertSkydriveFiles\bin\Debug\crifan.InsertSkydriveFiles.dll
" "
C:\Program Files (x86)\Windows Live\Writer\Plugins
""
exited with code 4.
Build FAILED.
Time Elapsed 00:00:01.00
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
【解决过程】
1. 看到上面的错误提示中,有对应的PostBuildEvent和XCOPY,然后知道了是上述的XCOPY命令出错了。
2.网上从 MSB3073: exited with code 4 得知“MSB3073 is just a generic error that means an Exec task returned a non-zero error code. ”。且在这里Xcopy,中找到exit code 的含义:
Exit code
Description
0
Files were copied without error.
1
No files were found to copy.
2
The user pressed CTRL+C to terminate xcopy.
4
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.
5
Disk write error occurred.
对照解释来分析此处的错误原因:
(1)no enough memory or disk space:此处硬盘空间足够大,故不是此原因
(2) entered an invalid drive name:之前此命令可以正常执行的,所以也不是此原因。
(3)invalid syntax on command line:同上,故也不是此原因。
官方文档描述的原因,都不匹配。
3. 后来还是自己找到了原因:XCOPY所拷贝的目标文件“"C:\Program Files (x86)\Windows Live\Writer\Plugins”中的“crifan.InsertSkydriveFiles.dll”正在被使用,导致XCOPY无法覆盖式的将crifan.InsertSkydriveFiles.dll拷贝过去,才导致上述错误的。
而“crifan.InsertSkydriveFiles.dll”正在被使用,是因为其是WLW(Windows Live Writer)的一个插件,而当前打开了WLW,插件也被加载了,所以是“正在使用”,导致XCOPY无法将原先的crifan.InsertSkydriveFiles.dl拷贝到C:\Program Files (x86)\Windows Live\Writer\Plugins,无法将其覆盖。
【总结】
如果出现MSB3073类错误,那么说明是程序运行出错(返回值非0)。
具体的错误原因,需要根据当前程序以及返回值来确定。
就像此处的,当前运行程序是XCOPY,返回错误代码是4,对应的根本原因找到了是无法把源文件拷贝到目标文件夹去,因为目标文件夹下的同名源文件正在被使用,而导致XCOPY出错,返回值为4的。
- xxx\Microsoft.Common.targets: error MSB3073: The command xxx exited with code 4
- Microsoft.CppCommon.targets(574,5): error MSB6006: "mt.exe" exited with code 31.解决办法
- Microsoft.CppCommon.targets(574,5): error MSB6006: "mt.exe" exited with code 31.解决办法
- vs2010编译错误:error MSB3073: :VCEnd" exited with code 1.
- Visual Studio: MSB3073 error exited with code 1
- 调试错误 error MSB3073: :VCEnd" exited with code 解决办法
- The command “” exited with code 9009
- Fix The thread xxx has exited with code 259 (0×103)
- 使用vs2013编译时遇到error msb3073 vcend exited with code 1
- cocos2d-x 用VS2010 编译示例失败 MSB3073: exited with code 4
- Couldn't register com.zyg.ios.XXX with the bootstrap server. Error: unknown error code.
- Git Commit failed with error The Git process exited with the code -1,073,741,819
- Error creating bean with name 'XXX' in the [XXXX.xml] --The import XXX cannot be resolved
- error "cmd.exe" exited with code 1
- Code Sign error: Application Identifier 'xxx' which doesn't match the current setting 'xxx'
- Couldn't register xxx.xxx.xxx with the bootstrap server
- linker command failed with exit code 1 (use -v to see invocation) xxx.app/xxx file not found test
- Error MSB3073: The command regsvr32 /s /c出错
- 多线程
- 大规模网页去重系统的简单设计和实现
- 需求分析挑战之旅(疯狂的订餐系统)(3)——背景-需要-需求规格
- 【JAVA教程】第八讲 Java网络编程(1)
- php上传类
- xxx\Microsoft.Common.targets: error MSB3073: The command xxx exited with code 4
- Hibernate3 注解详解
- 【JAVA教程】第八讲 Java网络编程(2)
- Emacs和Vim:神的编辑器和编辑器之神
- poj - 2528 - Mayor's posters 线段树+离散化
- 网狐 赠送游戏币 数据库异常
- rtp send receive
- Java新手入门的30个基本概念
- 从C到C++