Today I discovered something that makes me sad: objects of type System.Generic.Collections.List don't have a number of the useful extension methods I've come to love, such as Find, FindAll, FindIndex, Exists, RemoveAll, etc.
The object browser in VS2008 shows that those methods exist in the mscorlib version I'm using, but if I look at the assembly in ildasm they're not there.
Am I missing something obvious here or is there some way to make them available to my Silverlight app?
Also, I wonder if there's a good reference out there for what's different between Silverlight's runtime and the "real" one.
Thanks!
What's likely happening here is that Object Browser is resolving to the normal 2.0 mscorlib instead of the version that is used for silverlight.
I don't find it suprising that the Find extension method is missing for a SilverLight app. The .Net framework for SilverLight is stripped down pretty far in order to make it small enough to be a speedy download for users. They had to make some hard cuts and many items didn't make it.
If you need the method though, why not just add it yourself? Adding all of them may get tiring after awhile but it can be used to work around this issue.
Just one quick point: Find
isn't an extension method. It's a perfectly normal instance method.
However, it doesn't entirely surprise me that there are bits "missing" from List<T>
in Silverlight. It is a cut-down version of the framework. Unfortunately I don't know of any resource to say what's in and what's out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With