Mage.exe不会为4.5生成compatibleFrameworks

时间:2015-07-02 11:03:57

标签: c# .net mage

我尝试使用mage.exe(位于“C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v8.1A \ bin \ NETFX 4.5.1 Tools \ mage.exe”)来生成clickonce来自应用程序目标.Net 4.5的文件。 Exerything工作正常但在* .application文件中有一个“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>

我不知道为什么框架设置为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没有在兼容框架上设置正确的版本?我不想手动修改它。

1 个答案:

答案 0 :(得分:4)

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

法师3.5.30729.1

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

文件中没有compatibleFrameworks元素

Mage 4.0.30319.18020

C:\ Program Files(x86)\ Microsoft SDKs \ 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>

Mage 4.0.30319.33440

C:\ Program Files(x86)\ Microsoft SDKs \ 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>

Mage 4.6.81.0

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

<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 SDKs \ Windows \ v10.0A \ bin \ NETFX 4.6.1 Tools \ mage.exe

<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>
相关问题