1. 程式人生 > >error MSB6006:"mt.exe" exited with code 31的解決辦法

error MSB6006:"mt.exe" exited with code 31的解決辦法

一、問題出現

  用VS編譯專案的時候,總是遇到error MSB6006: "mt.exe" exited with code 31.這個問題。

具體錯誤如下:

二、解決辦法

  設定project的屬性Manifest Tool,把 “Input and Output”中的"Embed Manifest" 設定成No,具體操作如圖:


三、問題原因

  原因和manifest有關,看到別人的部落格中的解釋:

According to Microsoft's documentation, Mt.exe is "a tool that generates signed files and catalogs". Mt.exe is used in the manifest generation process. If you don't know what a manifest is,

further documentation explains: "A manifest is an XML document that can be an external XML file or a resource embedded inside an application or an assembly. The manifest of an isolated application is used to manage the names and versions of shared side-by-side assemblies to which the application should bind at run time. The manifest of a side-by-side assembly specifies its dependencies on names, versions, resources, and other assemblies."

  具體翻譯就是:根據微軟的文件,MT.EXE是“生成簽名的檔案和目錄的工具”。 MT.EXE採用的是清單生成過程。如果你不知道什麼是明顯的是,更多的文件解釋說:“manifest 是一個 XML 文件,可以是外部 XML 檔案,也可以是嵌入應用程式或程式集內的資源。isolated application 的清單用於管理該應用程式在執行時應該繫結到的共享並行程式集的名稱和版本。side-by-side assembly 的清單指定該程式集在名稱、版本、資源和其他程式集上的依賴項。“