Working on a side project, I started getting a very odd persistent error. Placing a user control onto a window using the Visual Studio designer gave an error dialog “Provide value on ‘System.Windows.Markup.StaticResourceHolder’ threw an exception.” Hand coding the Xaml for the user control gave the same error:

A thorough consultation with Professor Google and Dr Bing left me none the wiser, as most of the search results were discussing the difference between StaticResource and DynamicResource.

Falling back on the age old technique of “deleting things until it works”, I managed to isolate the source of the problem: My user control used a custom converter defined in a different assembly that wasn’t referenced by my main project. Adding the project reference to my main project fixed the problem.

While I’m pleased to have the problem solved, I’m also frustrated at how long it took me to solve the problem. If the exception included more detail, (e.g. the message “Unable to resolve type StringCaseValueConverter”) then I would have been able to fix things immediately.

Lesson: When throwing an exception, include sufficient information to allow someone to diagnose and fix the fault.

Comments

blog comments powered by Disqus
Next Post
Warning MSB3247: Found conflicts between different versions of the same dependent assembly  13 Sep 2011
Prior Post
Lessons learnt at TechEd  06 Sep 2011
Related Posts
Old blog posts, restored  26 Oct 2025
Better Table Tests in Go  21 Oct 2025
Error assertions  26 Apr 2025
Browsers and WSL  31 Mar 2024
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Archives
September 2011
2011