Joe White’s Blog

Life, .NET, and Cats


XamlParseException in WinRT

I’m writing a video game (as always), this time as a Windows 8 app. Currently I’m still developing on a VM running the Release Preview of Windows 8 and Visual Studio 2012, but I just got a chance to build and run on a machine running the final RTM versions of both.

When I ran my app, it showed the splash screen for a second or so, then dumped me back to the Start screen. So I tried running under the debugger, and got a XamlParseException: “XAML parsing failed.”

<rant>

I’ve commented before that Microsoft obviously put their most junior programmers to work on writing the WinForms ToolStrip in .NET 2.0. (If you haven’t had to deal with the flaky design, and bugs, of ToolStrip, be glad.) They had to give ToolStrip to their junior devs, because all their experienced devs were already busy working on WPF.

With WinRT, it’s pretty clear that all their junior people were working on error handling. The number of things that fail with absolutely meaningless errors (e.g. “A COM error occurred”) is staggering. Makes me wonder what they’ve got the senior devs busy on, if it’s not WinRT.

</rant>

Anyway, it turns out the problem is a codegen bug if your assembly has a dot in its name. There’s a simple workaround: go into Project Properties > Application tab > Assembly name, and change it to something with no dots in it. (I’ll probably also rename the .csproj and the folder to match, but that’s not necessary.)

The knowledgebase article says this is a problem with XAML-based controls, but I haven’t seen a problem with our WPF4 code at work. So either it’s only WinRT (rather than all XAML as the KB article suggests), or it’s only a problem with .NET 4.5.

There’s allegedly a hotfix that will fix the codegen bug properly, but there’s no actual way to download the hotfix. Easiest thing is to rename the assemblies, or wait for the service pack.

There are no responses to “XamlParseException in WinRT” yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Joe White's Blog copyright © 2004-2011. Portions of the site layout use Yahoo! YUI Reset, Fonts, and Grids.
Proudly powered by WordPress. Entries (RSS) and Comments (RSS). Privacy policy