Interestingly, this has been identified for several versions now (you stated that a 3.5 issue was fixed in 4.0). Here is a post from 2007. The rest of the IList
methods in 4.0 are correctly tied to the IList<T>
methods. I think that there are 2 likely explanations (of the bug/feature variety):
- This is an actual bug that Microsoft has not yet fixed.
- This is a feature that some other Microsoft code is
exploitingleveraging to add items without setting theHasLoadedOrAssignedValues
.
It is probably both – a bug that other code inside the framework is counting on. Sounds like someone said to themselves:
No one is really going to cast this into an IList and then call the Add method, right?