Visual Studio发布生成事件MT.exe命令失败,代码为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"

以代码9009退出时失败.有什么建议吗?

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

尝试在mt.exe路径周围添加引号,例如:

Try adding quotes around the mt.exe path, e.g.:

"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe"

此外,请确保该路径有效.

Also, make sure that path is valid.

希望这会有所帮助.我整天都在反对代码9009,这似乎是行之有效的.

Hope this helps. I've been beating my head against code 9009 all day and a full quoted path seem to make it work.