我的应用程序在VS 2010中运行良好,但当我将可执行文件从bin文件夹复制到另一个位置时,出现以下错误:
“设置属性“System.Windows.ResourceDictionary.DeferrableContent”引发了异常。”行号为“15”,行位置为“23”。
经过一些测试,我发现如果在与可执行文件相同的位置包含“System.Windows.Controls.Input.Toolkit”、“System.Windows.Controls.Layout.Toolkit”和“WPFToolkit” Dlls,则可以正常工作。
我的应用程序正在使用Infragistics Metro Dark主题,我是使用NuGet添加的。这是我在App.xaml中添加的内容:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/XENON;component/Themes/MetroDark/MetroDark.MSControls.Core.Implicit.xaml" />
<ResourceDictionary Source="/XENON;component/Themes/MetroDark/MetroDark.MSControls.Toolkit.Implicit.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>