Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Post Build Event MT.exe command fails with code 9009

Hi I am running following command from my post build event:

C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe -manifest "$(ProjectDir)$(TargetName).exe.manifest" -updateresource:"$(TargetDir)$(TargetName).exe;#1"

It is failing with Exited with code 9009... I don't understand why this happens; any suggestions?

like image 872
Anand Avatar asked Jan 13 '11 05:01

Anand


People also ask

How do I fix error code 9009?

Download Outbyte PC Repair application See more information about Outbyte; uninstall instructions; EULA; Privacy Policy. Click the Scan Now button to detect issues and abnormalities. Click the Repair All button to fix the issues.

What is code 9009?

Error Code 9009 means error file not found. All the underlying reasons posted in the answers here are good inspiration to figure out why, but the error itself simply means a bad path.

What is Mt Exe?

The Mt.exe file is a tool that generates signed files and catalogs. It is available in the Microsoft Windows Software Development Kit (SDK). Mt.exe requires that the file referenced in the manifest be present in the same directory as the manifest.


1 Answers

Exit code 9009 is a file not found error. The spaces that exist in your path to the post build command cause errors in a command prompt unless you include quotes around the entire path and executable name. Essentially, in your post-build command, it is trying to execute C:\Program with the arguments:

  • Files\Microsoft
  • SDKs\Windows\v7.0A\bin\mt.exe
  • -manifest "$(ProjectDir)$(TargetName).exe.manifest"
  • -updateresource:"$(TargetDir)$(TargetName).exe;#1"

Since obviously you don't have a file called Program residing in your root directory, this entire command fails. Encapsulating the path and executable in quotes will cause the entire expression to be evaluated as a single command, so everything should work fine if you change the post-build command to:

"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe" -manifest "$(ProjectDir)$(TargetName).exe.manifest" -updateresource:"$(TargetDir)$(TargetName).exe;#1"

Or use for VisualStudio x86 in Windows x64

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe"
like image 105
Nathan Wheeler Avatar answered Sep 21 '22 19:09

Nathan Wheeler