c# - Mage.exe 不为 4.5 生成兼容的框架

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

最佳答案

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

法师 3.5.30729.1

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

文件中没有 compatibleFrameworks 元素

法师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>

法师 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>

法师 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>

法师 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>

关于c# - Mage.exe 不为 4.5 生成兼容的框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31182809/

相关文章:

.net - ADO.Net 连接池已达到最大池大小

php - Magento 事件观察器在某些机器上无法工作

clickonce - SignTool 验证 .application 和 .manifest 文件的等效项?

c# - 为什么 .NET Core 应用程序总是很重?

c# - 如何防止应用程序运行时数据网格中的行闪烁

c# - 如何使用 C# 比较两个列表?

php - 添加到 grid.php 文件的网格选择

c# - 如何在 ajax.actionlink 中显示 »

c# - 将 HttpContent 转换为 byte[]

.net - 如何最好地实现 IoC 注入(inject)组件的按 View 生命周期