We recently updated our Terminator for Windows Desktop application to use the async/await features and still target .NET 4.0 so our XP customers can continue running the program.
So, first we updated our copy of Visual Studio 2012 to the latest and greatest release 2, and installed NuGet too. So far so good.
Our installer is based on WiX, so we also updated to version 3.7, but we built our own bootstrapper, so we ported that to VS 2012.
Unfortunately, that led us to discover that a regression causes VS2012 Rel 2 to produce programs that don’t actually run on XP, as described here on connect, but luckily there’s a solution that works on the workaround page
That’s the first hurdle down. So, we then added support for Microsoft.Bcl.Async by typing into the NuGet Package Manager Console:
From there we could target.net and declare async entry points and await them to our hearts content.
So it came time to obfuscate. We use EazFUSCATOR.net, which lets you trial for free for 30 days. We’ve found it well worth the investment to purchase this package, which also gives support. Unfortunately, VS2012 and Microsoft.Bcl.Async broke Eazfuscator 3.7, but the team there pulled out all of the stops and got us a beta that fixed the problems we’ve had within 24 hours of each problem.
So, we were good to go. We tested it all and everything seemed hunky dory. The only thing was, we started to notice that the async routines seemed to be very async.
Well, so async that they never, ever completed. This was a bit of a puzzle. It appeared that the methods were never completing at all. So what went wrong?
It turns out that you must actually install some new DLL’s when you install your package, or it will just fail silently (which was the real surprise).
Needless to say, we’d forgotten to add these into our WiX installer, and as a result the machines that were using the installer were failing to fetch the cloud overlay, until we added them.