XamlParseException occurred

But if you get a XamlParseException error, what are you going to search for?

I know how lost you can feel when that happens. XamlParseExceptions can be caused by a lot of things. Most of the time the troubled resource is stated in the error. But if you get the following error, what are you going to search for?


The dictionary key ‘’ is already used. Key attributes are used as keys when inserting objects into a dictionary and must be unique.

If this error occurs, it’s possible there are implicit styles that target a type more than once. In my case I got stuck with the following code after a version control update:

<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}" />
<Style TargetType="HyperlinkButton" BasedOn="{StaticResource DefaultHyperlinkButtonStyle}" />
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}" />

Implicit style defined twice

When I removed the second ComboBox style the error was gone. I hope this helps!

Grüsse aus Berlin!
This is a cookie free and popup free website.
Join me in making the web enjoyable again by removing the need for annoying cookie warnings and silly newsletter overlays!