Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF executable won't run outside of Visual Studio (resource dictionary issue)

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

The problem appears to be that the executable can't find "PresentationFramework.Aero", which I added to my App's 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 proper way to include the Aero theme (or point to it) so I can release my app?


Here's the exact error I'm getting:

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

like image 853
devuxer Avatar asked Jul 14 '10 19:07

devuxer


1 Answers

Turned out I just needed to add some detail 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" />
like image 103
devuxer Avatar answered Oct 21 '22 17:10

devuxer