0
votes

I wrote simple application on VS2010 that send httpwebrequest and without any configurations fiddler is captures this request. But after, I installed VS2012 and run fiddler, and when i send request i have exception "Operation timed out" and request is no captured. When i close fiddler all requests are sends. I delete VS2012 and .net framework 4.5. After that request are sends and fiddler capturing them.
Why fiddler dont't capture traffic when .net4.5 installed?

1
You'll need to provide more details; Fiddler works just fine with .NET4.5 installed and I use it there every day. Does your machine.config or app.config specify a proxy? What happens if your client requests 127.0.0.1:8888? - EricLaw
I am from Microsoft .NET Framework Compatibility team. We are unable to reproduce the issue. Please contact us on netfx45compat at Microsoft dot com if you are able to reproduce the issue. Thanks - Varun

1 Answers

1
votes

Did you by any chance try to set the Host property of the HttpWebRequest? This may be the cause of your problem.

I have also .NET 4.5 installed and experience the same situation. I get the same error when fiddler is running and is acting as a proxy. The error is:

System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse()

Here is a trivial sample that reproduces the problem:

using System;
using System.IO;
using System.Net;

namespace WebRequestTest
{
    class Program
    {
        static void Main(string[] args)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.microsoft.com");
            request.Host = "www.microsoft.com";//If I comment this line, capturing with fiddler works OK.
            request.Method = "GET";
            request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0";

            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            using (Stream stream = response.GetResponseStream())
            using (StreamReader sr = new StreamReader(stream))
            {
                string content = sr.ReadToEnd();
                Console.WriteLine(content);
            }
        }
    }
}

In my case I just had to comment the request.Host="www.microsoft.com" line and everything worked OK.

I suspect same behavior will occur when using an HTTP proxy other than fiddler, but I have not tested it though.