I have a very simple set of styles that I\'m using in a couple of different WPF applications. I have this style stored in a Xaml file in a common project, then added by merging
I had the same kind of issue, and for me it was the way the resource files were added to the project.
I had to make sure each and every one of my xaml style resource files were set up as "Page" (in the "build action" property). By default, they were not all in this mode (some as "Content", other as "compile" or "embedded resource" or "resource") and that caused this kind of issue.
maybe it's the same for you...
edit : from what I could gather, it has something to do with how the xaml code is embedded in the project and specifically the Order in which it is parsed by WPF: if the source file is set as "Page", the order in which the dictionary are merged is not taken into account, so this would work in release mode:
but this would not work with the other options (not all of them anyway, I did not try every single one of them) since the call would be parsed before the definition.
As to why it works in debug mode and not in release (or in your case when you start without debug), I guessed it was because WPF parses and stores resources into memory differently depending on the mode you're in (debug or not). I think WPF stores everything in memory in debug mode while it only stores what it needs in release mode (so for instance the calling code and not the definition code), but then again, it's just my guess...
edit 2: for me it was a nightmare to debug because it was even worse: it worked in some release configurations and not others because depending on the order of the actions taken by the user, he would get the error or not (the resource might already have been charged in memory or not when called, depending on what WPf already needed at this point), and of course I could not "debug" per say, since the debug mode always worked... It took me a while before figuring this solution out... glad it helped