Windows Store Apps: Threads to Tasks

Posted on June 21, 2013

If you're updating an old .NET code base to a Windows Store app, you may notice that the Thread class is no longer available.  Instead, we have the more sophisticated Task.  If you have a lot of Thread usage in your old code, you may find a re-write of the threading code to be a large task (sorry). Here's some code that you can use in place of the missing Thread class. This uses Tasks under the hood: using System; using System.Thre...

Read More


PDX Code Camp Session: WP7 Tips & Tricks

Posted on May 23, 2010

I presented the Windows Phone 7 Tips & Tricks session with Allen Newton yesterday at Portland Code Camp.  Good times.  In our talk we showed a sample application "PDX Chow" that demonstrates a number of phone development concepts: MVVM architecture with Laurent Bugnion's MVVM Light Panorama control Inversion of Control / Dependency Injection Navigation using commanding and context Page orientation events Accessing ...

Read More


.NET 101

Posted on October 26, 2009

If you find yourself wanting yourself to share some C# brilliance related to… The difference between Object.Equals() and == How string comparison is an interesting special case Why class instance memory is not necessarily reclaimed when an instance goes out of scope Which of Stream.Close() and Stream.Dispose() should be called (or both) Please remember that it is not 2001.  Everyone knows these things (unless you’re in a ...

Read More


FatalExecutionEngineError returning from WPF PageFunction

Posted on November 30, 2007

I'm posting this for future reference.  If you invoke a PageFunction and add an event handler to the PageFunction's Return event, the event handler must be an instance method of the calling page.  No other method will do.  If the event handler doesn't meet this criteria, you'll see the FatalExecutionEngineError thrown when you return from the PageFunction.  Sorry, no separation of concerns allowed.

Read More


ClickOnce Error after upgrading to VS 2008

Posted on November 29, 2007

We recently upgraded to VS 2008 RTM at work, and shortly after discovered that a new build of our ClickOnce-deployed WinForms application failed to install correctly!  During the download process, a message box would display, and the log details revealed an InvalidDeploymentException (RefDefValidation) in System.Deployment.Application.DownloadManager.ProcessDownloadedFile(). Let me just say that days of fruitless investigation followed. ...

Read More