I heart WPF in Visual Studio because it’s incredibly easy to separate business logic from the user interface. However, I don’t really heart the Visual Studio WPF designer.

Expression Blend 4 is out now, so I just loaded up our latest secret Windows Home Server Add-In project (it’s WPF, did I mention how much I love WPF?). And I was greeted with this lovely error message:

Exception: An error occurred while finding the resource dictionary “/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component\themes/aero.normalcolor.xaml”.

StackTrace: Empty

InnerException: None

Which is helpful. Obviously, we’re forcing WPF to use the Aero theme (because Windows Home Server is based on Windows Server 2003, and the default theme is horrid), and Expression Blend is having issues finding that theme file. It works fine in Visual Studio and at runtime, but not in Expression Blend.

The solution is to stop specifying the specific version of the use syntax that Expression Blend understands, and to add an explicit reference in the project to PresentationFramework.Aero.dll.

We go from this:

    <ResourceDictionary Source="/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component/themes/aero.normalcolor.xaml" />
To this:

    <ResourceDictionary Source="/PresentationFramework.Aero,Version=,Culture=neutral,PublicKeyToken=31bf3856ad364e35,ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />

And everyone is happy.

Edit: Actually, everyone was not happy. The Add-In threw some nasty exceptions when I loaded it up with the version number removed. The solution has been amended above.

posted on Thursday, June 10, 2010 11:47 AM | Filed Under [ Windows Home Server Development ]


Site Sections

Recent Posts


Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development