WPF executable will not run outside of Visual Studio (resource dictionary issue)

I have a WPF application that works fine if I debug (F5) in Visual Studio (both Debug and Release modes work), but if I try to double-click the .exe file in the bin \ Release folder, Windows immediately kills the application.

The problem is that the executable cannot find "PresentationFramework.Aero", which I added to the application resource dictionaries as follows:

<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml" /> <ResourceDictionary Source="pack://application:,,,/WPFToolkit;component/Themes/Aero.NormalColor.xaml" /> </ResourceDictionary.MergedDictionaries> 

What is the correct way to enable the Aero theme (or point to it) so that I can free my application?


Here is the exact error I get:

Failed to load file or assembly 'PresentationFramework.Aero, Culture = neutral' or one of its dependencies. The system cannot find the specified file. ":" PresentationFramework.Aero, Culture = neutral

+7
wpf xaml resourcedictionary
source share
1 answer

It turned out that I just needed to add some details to my first ResourceDictionary declaration:

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

All Articles