Async/await for compact framework v3.5 - manual implementation

You can use Visual Studio 2015 to compile to Compact Framework 3.5 by following the instructions below:

  • Install the '.NET Compact Framework 3.5 Redistributable';
  • Copy files from 'C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE';
  • Paste the files at 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\CompactFramework' directory;
  • Create a directory named 'RedistList';
  • Create a file named 'FrameworkList.xml' at 'RedistList' directory;
  • Set the follwing content to the file created:

    <?xml version="1.0" encoding="utf-8"?>
    <FileList Redist="Net35-CF" Name=".NET Compact Framework 3.5">
    </FileList>
    

Now you can create a .NET Core Class Library project on Visual Studio 2015 and target 'net35-cf' framework.

To use async/await you can use the NETStandard.WindowsCE package.

An example project can be found at: https://github.com/WindowsCE/System.Collections.Immutable

Disclaimer: I'm the author of the package and the project above.


I think that adding support for async-await to a platform that doesn't natively support it should be doable, because that's exactly what Microsoft.Bcl.Async does for .Net 4.0.

But using async-await requires compiler that supports it, there is no way around that. That means VS 2012 or possibly VS 2010 with the Async CTP (but I wouldn't recommend that, it's not production quality). As far as I know, there is no way to make this work with VS 2008.

One more possibility would be to use Mono, but I have no idea if it supports WinCE.