Debug Side Effects With StreamReader
Say you get the response stream, and you want to see what the value is in the Watch.
Dim resp As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)You click the little refresh button you can evaluate the stream and view the response. However, when the stream returns the object it will be string.empty. Visual Studio 2012 does warn you about it having side-effects, but I did not think it would be to this extent. I would think it would reset the stream to the previous state when continuing, but it does not. Odd.
Dim sr As New System.IO.StreamReader(resp.GetResponseStream())
Return sr.ReadToEnd()
Comments
Post a Comment