I ran into this problem today while migrating a VS2008 solution to VS2010. The problem occurred in either of the following scenarios:
Look for an MSB8012 warnings. Likely you have a different output specification for the C++ output value and the Linker Output value.
I have a project (*.sln) written in visual studio c 8.0. It was migrated to VC10 recently. When I choose the "Release mode", it was compiled sucessfully. But if I choose "Debug mode", the error " MSB6006 mt.exe code 31" happened.
I found that, in the debug mode, it used a wrong sub-project to startup. After fixing the startup sub-project, it goes fine so far.
---- new status --- This won't fix the problem. It just makes the problem disapear temporalily by rebuilding-all. Also, there are other faults caused by the migration. The "resources.h" is missed from the new project and the "winres.rc" is shorten.
Run VS as administrator. It solved the problem for me.
Check if you have any anti-virus software like AVG. Exclude the manifest files in the anti-virus software exclusion list.
In my projects, the Intermediate and Output directories were set to:
Under C/C++-->Output Files, I had the following:
Under Linker-->Manifest File, I had:
The cure was to remove the trailing \
from my C/C++-->Output Files section (because it's already part of those variables):
Normally, the double-up of using $(IntDir)
or $(OutDir)
with a trailing \
doesn't seem to cause trouble, even though it's bad practice. I can't remember now whether I did it by accident or if the conversion process did it, but for whatever reason, it seems to have been messing up MT.exe.
I hope this is useful to anyone else who encounters this problem. Your settings may well be different, but consider that it may be related to improperly formed filenames.