Using Linq methods causes missing references to DependencyObject in WindowsBase
- by Jason Coyne
I have some c# source that I want to compile using CodeDom within my application (for a plugin)
Everything works fine, except if I use a Linq extension function on some of my collections
var dict = new Dictionary<KeyType, ValueType>();
....
dict.Any(KV=>KV.Key == "Some Key);
When I try to compile source that has this code, it CodeDom complains that I am missing a reference to DependencyObject in WindowsBase.
I do not understand why this is happening. Neither the Dictionary class, or the Any extension method reference that class, which apparently is part of Windows.Forms
I would normally just ignore the quirk, make the CodeDom add a reference and move on, but Apparently WindowsBase is special and is not always distributed and I don't want to cause issues for users that may not have it installed correctly.