2010-07-14 48 views
7

我有一個WPF應用程序,如果我在Visual Studio中調試(F5)(調試和發佈模式都可以),但是如果我嘗試要雙擊bin \ Release文件夾中的.exe,Windows立即殺死應用程序。WPF可執行文件不會在Visual Studio外運行(資源字典問題)

這個問題似乎是可執行文件無法找到「PresentationFramework.Aero」,這是我加入到我的應用程序的資源字典如下:

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

什麼是包括Aero主題的正確方法(或指向它),所以我可以釋放我的應用程序?


這裏是我得到確切的錯誤:

無法加載文件或程序集「PresentationFramework.Aero,文化=中性」或它的一個依賴。該系統找不到指定的文件。「:」 PresentationFramework.Aero,文化=中性

回答

7

原來我只是需要一些細節添加到我的第一個ResourceDictionary聲明:

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