14

We are using Mage.exe to generate our application's manifests as part of our build process. Upon upgrading to .NET 4 we now find it generates an invalid manifest.

The reason is there isn't a compatibleFrameworks attribute being set in the application manifest which we generate every build.

Is there a way we can make Mage.exe add this element or should we only ever update existing manifests?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kev Hunter
  • 2,565
  • 4
  • 25
  • 39

2 Answers2

7

There is a separate copy of mage.exe built for .NET 4.0. Try using this copy from C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools (or ...\v7.1\Bin\NETFX 4.0 Tools depending on which SDK version you have installed).

I was actually having this same problem and using the mage.exe from NETFX 4.0 Tools fixed it for me.

joshuapoehls
  • 32,695
  • 11
  • 50
  • 61
  • 1
    Just to confirm that there is indeed a .Net 4 specific mage.exe (version 4.0.30319.1). The previous version was 3.5.30729.1 and using that version for a .Net 4 application results in the reported error for me. – redcalx May 29 '13 at 15:35
  • If you've tried "all the versions" of mage / mageUI and had no success (as I did) then you might want to look at calling the MSBuild task from code as is mentioned [in this answer](http://stackoverflow.com/questions/11141655/updating-deployment-manifest-for-a-clickonce-application-programmatically-result) – Shaun Mar 07 '16 at 10:45
5

Add this to your GenerateDeploymentManifest MSBuild task

   TargetFrameworkMoniker=".NETFramework,Version=v4.0"        

and that should fix it

  • error MSB4064: The "TargetFrameworkMoniker" parameter is not supported by the "GenerateDeploymentManifest" task. Verify the parameter exists on the task, and it is a settable public instance property. – Noel Kennedy Jun 24 '10 at 13:04
  • If you get error 4064 you need to change make sure the ToolsVersion is update to 4.0 from 3.5 – Ido Ran Nov 17 '10 at 20:31