3

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.

user3896104
  • 107
  • 1
  • 4

1 Answers1

5

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>
Glen Thomas
  • 10,190
  • 5
  • 33
  • 65