How do I resolve error MSB6006: “cmd.exe” exited w

2019-08-03 15:16发布

问题:

I am getting the following error when building my code:

C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error      
MSB6006: "cmd.exe" exited with code 3.
Done executing task "CustomBuild" -- FAILED. (TaskId:40)

How do I resolve this?

回答1:

Open your .vcxproj file as a .xml file (so with Notepad++ or equivalent.)

You should be able to search the file for the "CustomBuild" tag.

Something in the task defined by that tag is failing.

You can test what it is by trying to run the commands in that task from the command line in the same directory as the .vcxproj.

If you can't solve your problem from there I'd recommend adding the "CustomBuild" task to the question so we can better help you.