Raf's laboratory Abstracts Feed Raffaele Rialdi personal website

I am Raf logo

Windows 8 Release Preview and the unhandled exception 0xC000027B

June 25, 2012
http://iamraf.net/News/windows-8-release-preview-and-the-unhandled-except

The good news (for us) is that we, in my company, obtained the Token for publishing the new Metro-Style applications on the Windows 8 Store. Currently the Store is not yet accessible from the broad public unless you pass a sort of pre-certification.

While we were working on the Barcode application we received a random unhandled exception 0xC000027B that has no history on the internet nor an equivalent error description that can hint a solution.

What the developer should do in those cases? The normal diagnostic path is the following:

  • From the project properties, Debug options, enable the "Mixed Mode Debugging". As WinRT and Xaml dlls are native (C++) many details would be hidden without enabling the native debugger.
  • Reproduce the problem under those conditions and look at the "Output Window" in Visual Studio. With the native/mixed debugger enabled, you will now see more messages in that window.
  • Take a look at the "Call Stack Window". If you find a call of yours in the stack trace, you have a good starting point to understand the causes. Otherwise, it may that the problem happens during the rendering loop, in the dispatcher thread. In this case you will only see Microsoft libraries such as the Windows.UI.Xaml.dll.
  • If you want to understand what the WinRT/Xaml libraries were doing, the assembly code will not help you, but we have one more weapon. In the Visual Studio Tools – Options – Debugging – Symbols window, enable the Microsoft Symbol Servers. You can also use the "Modules Window" to see if there are symbols loaded for all the dlls used by your app.
  • Public symbols will give a function/method name to the assembly code. You will not see the sources, but the method name can be very helpful.

Now let's go back to the problem we had. The above procedure didn't help at all as there were no public symbols available for the Windows.UI.Xaml.dll and the bad exception was originated from there.

We applied the old trick of copying the project in another folder and delete parts of the UI until it disappeared. Yes, it's not a good situation, but it was the last resort.

And it worked great, as we identified that the cause was the tag <Image … /> inside the Grid used to layout the page. Going forward and backward this page, caused the unhandled exception after 10-20 times. We found more variabled that influece the bug, such as the transitions and the controls used in the page used to navigate to and even what the user is doing with the mouse. A mix of witchcraft and magic spell Winking smile.

The solution is super-easy: just put a <Border /> around every single image in the application… and the exception is gone!



rated 5 by 4 users



Share this page on Twitter


Privacy | Legal Copyright © Raffaele Rialdi 2009, Senior Software Developer, Consultant, p.iva IT01741850992, hosted by Vevy Europe Advanced Technologies Division. Site created by Raffaele Rialdi, 2009 - 2015 Hosted by: © 2008-2015 Vevy Europe S.p.A. - via Semeria, 16A - 16131 Genova - Italia - P.IVA 00269300109