Why is this OK:
using
Why and this isnt?
using (XmlTextReader xr = new XmlTextReader(new StringReader(response), /*...yada yada...*/){ try { retVal = xs.Deserialize(sr); } //yada yada yada}
Because StringReaders derive from System.IO.TextReader which implements IDisposable and that's what the using keywords cares about. XmlTextReader derives from the abstract XmlReader, and noone implements IDisposable. I suppose this has something to do with closing streams in the right order, blah blah. Either way, it was a minor sadness today.
Poop.
Ads by The Lounge