我尝试使用 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/