【问题标题】:WPF executable won't run outside of Visual Studio (resource dictionary issue)WPF 可执行文件不会在 Visual Studio 之外运行(资源字典问题)
【发布时间】:2010-07-14 19:45:04
【问题描述】:

如果我在 Visual Studio 中“调试”(F5)(调试和发布模式都可以),我有一个运行良好的 WPF 应用程序,但是如果我尝试双击 bin\Release 文件夹中的 .exe,Windows立即终止应用程序。

问题似乎是可执行文件找不到“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,Culture=neutral”或其依赖项之一。系统找不到指定的文件。":"PresentationFramework.Aero, Culture=neutral

【问题讨论】:

    标签: wpf xaml resourcedictionary


    【解决方案1】:

    原来我只需要在我的第一个 ResourceDictionary 声明中添加一些细节:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-23
      • 2019-12-04
      • 1970-01-01
      • 1970-01-01
      • 2011-08-26
      • 1970-01-01
      相关资源
      最近更新 更多