I have to develop an application for WinCE 5.0 which communicates/synchronizes data with a regular PC application which offers a webservice I can talk to with my mobile (industrial) device.
Since it is obvious to result in code which is hard to maintain on the mobile device side (check connection → when completed: check webservice availability → when completed: check whether mobile device is eligible for syncing → when completed start exchanging data) I would love to use the syncronous way of programming using await
s.
I have found some code snippet by Daniel Grunwald which is a minimal implementation of the stuff needed by the compiler for the async/await feature. Together with Task Parallel Library for .Net 3.5 (which I had to change just slightly because some methods called do not exist with the signature required) which implements the Task type for instance, it looks promising.
So far the solution does not build, because I'm lacking the implementation of TaskCompletionSource
. I decompiled the recent mscorlib with ILSpy, but the code is not usable - too many types in usage which are not present in CF.
At this point I am wondering whether this project is bound to fail, because I will never convince VS 2008 (which I have to use in ordner to target smart devices) to use the C# 5 compiler (maybe there is a workaround?), or CF is lacking crucial types for TaskCompletionSource (which I probably will need since I want to make events awaitable), or that TPL3.5 + Grunwald's snippet + TCS implementation will build but never actually work.
Can someone more experienced please appraise my intent? Would love to hear your comments, ideas and alternative approaches. Thanks.
Update Aaron Stainback's post indicates it should be possible to build CF 3.5 with VS2012. That should tackle at least the compiler issue.
BackgroundWorker
to implement on the Mobile devices we have. Parallel processing, however, requires a multi-core processor or it will only ever run in a single process anyway. Other than getting this to work as written, what is your goal? – Botts