C# Mage.exe不';t为4.5生产兼容的固件

C# Mage.exe不';t为4.5生产兼容的固件,c#,.net,mage,C#,.net,Mage,我试图使用mage.exe(位于“C:\Program Files(x86)\Microsoft SDK\Windows\v8.1A\bin\NETFX 4.5.1 Tools\mage.exe”中)从应用程序目标.Net 4.5中创建generete clickonce文件。操作正常,但在*.application文件中有一节“CompatibleFlameWorks”: 我不知道为什么框架设置为4.0。我希望在生成的文件中最终获得.Net 4.5,因此类似以下内容: <compat

我试图使用mage.exe(位于“C:\Program Files(x86)\Microsoft SDK\Windows\v8.1A\bin\NETFX 4.5.1 Tools\mage.exe”中)从应用程序目标.Net 4.5中创建generete clickonce文件。操作正常,但在*.application文件中有一节“CompatibleFlameWorks”:


我不知道为什么框架设置为4.0。我希望在生成的文件中最终获得.Net 4.5,因此类似以下内容:

<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
    <framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
  </compatibleFrameworks>


我应该换什么?为什么merge.exe没有在兼容框架上设置正确的版本?我不想手动修改此项。

根据使用的Mage版本的不同,兼容框架版本的设置也不同。我不知道有任何版本的法师将目标版本设置为4.5。Mage不是一个完整的工具,Microsoft建议您使用文本编辑器手动执行各种更改。在使用mage创建清单后,我正在使用Powershell编辑清单。您可能可以手动将targetVersion属性更改为4.5,然后重新签署清单

Mage 3.5.30729.1 C:\Program Files(x86)\Microsoft SDK\Windows\v10.0A\bin\NETFX 4.6.1 Tools\mage.exe

<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
文件中没有CompatibleFlameWorks元素

Mage 4.0.30319.18020 C:\Program Files(x86)\Microsoft SDK\Windows\v8.0A\bin\NETFX 4.0 Tools\mage.exe

<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>

Mage 4.0.30319.33440 C:\Program Files(x86)\Microsoft SDK\Windows\v8.1A\bin\NETFX 4.5.1 Tools\mage.exe

<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>

Mage 4.6.81.0 C:\Program Files(x86)\Microsoft SDK\Windows\v10.0A\bin\NETFX 4.6 Tools\mage.exe

<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>

Mage 4.6.1055.0 C:\Program Files(x86)\Microsoft SDK\Windows\v10.0A\bin\NETFX 4.6.1 Tools\mage.exe

<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="4.6" profile="Client" supportedRuntime="4.0.30319" />
  <framework targetVersion="4.6" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>


您的项目设置是否以4.5完整框架为目标?是的。项目属性中的目标框架设置为:.Net framework 4.5。如果我从VS运行Publish,生成的文件包含有关兼容框架的正确信息。奇怪的是,对于我来说,
C:\Program files\Microsoft SDK\Windows\v8.0A\bin\NETFX 4.0 Tools\MAGE.exe
生成了这个OK…您的命令看起来如何?