Mage.exe does not create compatible Frameworks for 4.5
I am trying to use mage.exe (located in "C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v8.1A \ bin \ NETFX 4.5.1 Tools \ mage.exe") to create clickonce files from targeting applications. Net 4.5. Exerything works fine, but there is a "compatibleFrameworks" section in the * .plplication file:
<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 installed in 4.0. I want to get definitively .Net 4.5 in the generated files, 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 doesn't merge.exe install the correct version on a compatible platform? I don't want to manually change this.
source to share
The compatible version of frameworks are installed differently depending on which version of the Magician is used. I am not aware of any versions of the wizard that set the target version to 4.5. The magician is not a complete tool, and there are various changes that Microsoft recommends to do manually with a text editor. I am using Powershell to edit my manifests after creating them with a wizard. You could probably manually change the targetVersion attribute to 4.5 and then re-sign the manifest.
Magician 3.5.30729.1
C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v10.0A \ bin \ NETFX 4.6.1 Tools \ mage.exe
Missing compatible Frameworks element in file
Magician 4.0.30319.18020
C: \ Program Files (x86) \ Microsoft SDK \ 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>
Magician 4.0.30319.33440
C: \ Program Files (x86) \ Microsoft SDK \ 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>
Magician 4.6.81.0
C: \ Program Files (x86) \ Microsoft SDK \ 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>
Magician 4.6.1055.0
C: \ Program Files (x86) \ Microsoft SDK \ 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>
source to share