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?
We are also having this problem. It isn't a matter of what framework your application is targeting (we are targetting the 4.0 client).
The problem is that Visual Studio 2012 will not produce a click once setup.exe that will run on XP. The error is missleading as it always reports that the program is not a valid Win32 application. It does this on any version of XP including 64-bit versions.
It is not your application causing the problem, it is the setup.exe produced by VS2012. The only way we have found to get around it is to publish using VS2010.