Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mage.exe doesn't produce compatibleFrameworks for 4.5

Tags:

c#

.net

mage

I'm try to use mage.exe (located in "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\mage.exe") to generete clickonce files from application targeting .Net 4.5. Exerything works fine but in *.application file there is a section "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>

I don't know why framework is set to 4.0. I'd like to get finally .Net 4.5 in generated files, so something like this:

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

What should I change? Why merge.exe doesn't set correct version on compatibile framework? I don't want to modify this manually.

like image 808
user3896104 Avatar asked Nov 20 '25 14:11

user3896104


1 Answers

The compatible frameworks version is set differently depending on which version of Mage is used. I am not aware of any versions of mage that set the target version to 4.5. Mage is not a complete tool and there are various changes that Microsoft recommend that you perform manually using a text editor. I am using Powershell to edit my manifests after creating them with mage. You could probably manually change the targetVersion attribute to 4.5 and then re-sign the manifest.

Mage 3.5.30729.1

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

No compatibleFrameworks element in file

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>
like image 144
Glen Thomas Avatar answered Nov 22 '25 03:11

Glen Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!