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

mikestram picture mikestram · Jun 15, 2015 · Viewed 8.9k times · Source

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:

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

Answer

mikestram picture mikestram · Jun 16, 2015

Found the solution.

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