WPF 'Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.'

10.2k views Asked by At

My application runs fine in VS 2010 but when I copy the executable from the bin folder to another location I get this error:

'Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.' Line number '15' and line position '23'.

Did a bit of testing and found out that if I include the 'System.Windows.Controls.Input.Toolkit', 'System.Windows.Controls.Layout.Toolkit', and 'WPFToolkit' Dlls in the same location as the executable it works.

My application is using the Infragistics Metro Dark theme which I added using NuGet. This is what I added in my 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>

Does anyone know why this is occurring? Any help would be appreciated.

1

There are 1 answers

0
mikestram On BEST ANSWER

Found the solution.

Removed MetroDark.MSControls.Toolkit.Implicit.xaml which was not needed and also deleted the Reference to the WPFToolkit Dll.