title: Running a .NET 4.5 program on XP with .NET 2.0
body: <p>We have a Windows Service written in C# 5.0 for .NET 4.5. My code is using some of the newer language features (<code>async</code> and <code>await</code>) and framework features (<code>Task.Run</code>, <code>Task.Delay</code>, <code>IProgress</code>, <code>CancellationToken</code>, etc).</p>
  
  <p>Our product works fine on Windows <strong>7</strong> and <strong>8</strong> when .NET 4.5 is installed. Our problem is, we now need this to run on an <strong>XP</strong> machine. Even if .NET 4.5 <a href="http://msdn.microsoft.com/en-gb/library/8z6watww.aspx" rel="noreferrer">could be installed on Windows XP</a>, there's not enough space for it on this machine anyway.</p>
  
  <p>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 <a href="http://www.mono-project.com/AOT" rel="noreferrer">Mono AOT Compiler</a> or <a href="http://msdn.microsoft.com/en-GB/library/6t9t5wcf%28v=vs.80%29.aspx" rel="noreferrer">NGen.exe</a>, but I haven't had any luck - I don't think either of them actually achieve what I'm trying to do.</p>
  
  <p>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?</p>
  
  <p>Another option we've had is to try and install .NET 4.0 and use the <a href="http://nuget.org/packages/Microsoft.CompilerServices.AsyncTargetingPack/" rel="noreferrer">Async Targeting Pack</a>.</p>
  
  <p>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?</p>