.netvisual-studio-2010windows-7windows-xpvisual-studio-2012

How do I target .NET 4.0.3 on XP using Visual Studio 2012? Application fails to run with "not a valid Win32 application"


I have a large application targeting .NET 4.0.3 that needs to run on XP. It builds fine using Visual Studio 2010 SP1 and runs properly on XP.

Building using Visual Studio 2012 targeting .NET 4.0.3 also builds fine and runs fine on Windows 7 but it fails to run on XP. I get an error saying MyApp.exe is not a valid Win32 application.

How do I continue to target .NET 4.0.3 with support for XP machines using Visual Studio 2012?


Solution

  • I'm not certain this will work, but try the trick shown here to manually set the subsystem version with EditBin.exe.