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)
    Dim sr As New System.IO.StreamReader(resp.GetResponseStream())
    Return sr.ReadToEnd()
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.




Comments

Popular posts from this blog

Asp.net Publishing Broke Site - "App_WebReferences is not allowed because the application is precompiled"

Telerik - Custom Group Footers In RadGrid