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.
Scott at DevReach in Bulgaria in October
Developer Stand up Comedy - Coding 4 Fun
TechDays/DevDays Netherlands and Belgium:
Posts by Category Posts by Month
Greatest Hits Dev Tools List