Q:

Running a .NET 4.5 program on XP with .NET 2.0

We have a Windows Service written in C# 5.0 for .NET 4.5. My code is using some of the newer language features (async and await) and framework features (Task.Run, Task.Delay, IProgress, CancellationToken, etc).
Our product works fine on Windows 7 and 8 when .NET 4.5 is installed. Our problem is, we now need this to run on an XP machine. Even if .NET 4.5 could be installed on Windows XP, there's not enough space for it on this machine anyway.
Is there any way I can get a .NET 4.5 application to run on this machine? I've looked into compiling the program to native code using either Mono AOT Compiler or NGen.exe, but I haven't had any luck - I don't think either of them actually achieve what I'm trying to do.
Failing that - we've thought of creating a bootable preinstalled flash drive that runs a simple version of Windows (like WinPE?) with our application installed, but this is out of my depth and I wouldn't really know where to start. Is this a good idea? How could I approach this?
Another option we've had is to try and install .NET 4.0 and use the Async Targeting Pack.
Or does anyone have any other ideas? Is there any way I can build/compile/run my .NET 4.5 application (that makes use of .NET 4.5 features) on an XP machine running .NET 2.0?

A:

AsyncBridge is like the MS Async Targeting Pack, but also available for .NET 3.5.
However, it won't work with .NET 2.0; as the Task Parallel Library (which defines Task<T>) is only available for .NET 3.5 (and built into .NET 4.0).
As for Mono, to create a standalone application that includes the relevant portions of the framework, you need to create a bundle, but I'm not sure if those are supported on Windows. mono --aot and ngen just precompile an application for faster startup on the local machine, they don't remove the need for the framework to be installed.

