Fiddler 未从 Windows 8 中的 C# 应用程序捕获流量

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18482769/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 12:20:59  来源:igfitidea点击:

Fiddler Not Capturing Traffic from my C# Application in Windows 8

c#fiddler

提问by James Jeffery

I have recently upgraded to a new computer with Windows 8. I have installed Fiddler, yet I am having problems capturing traffic sent and received from my C# application. I never had this issue on Windows 7, so I assume its a Windows 8 issue.

我最近升级到了一台装有 Windows 8 的新计算机。我已经安装了 Fiddler,但是我在捕获从我的 C# 应用程序发送和接收的流量时遇到了问题。我在 Windows 7 上从来没有遇到过这个问题,所以我认为它是 Windows 8 的问题。

The application is an ordinary WinForms application using C# 5.0 and .NET 4.5. I am using Visual Studio 2012.

该应用程序是使用 C# 5.0 和 .NET 4.5 的普通 WinForms 应用程序。我正在使用 Visual Studio 2012。

Any ideas how to get around this as I'm having a hard time debugging my application without it.

任何想法如何解决这个问题,因为我很难在没有它的情况下调试我的应用程序。

Fiddler captures traffic from Chrome and Firefox with no issues, just not my application. I have also loaded another application that I developed, and that works fine.

Fiddler 从 Chrome 和 Firefox 捕获流量没有问题,只是不是我的应用程序。我还加载了我开发的另一个应用程序,并且运行良好。

It may be worth noting that this is the first application I've developed that uses HttpClient to make Http requests. Could that be causing any issues?

可能值得注意的是,这是我开发的第一个使用 HttpClient 发出 Http 请求的应用程序。这会导致任何问题吗?

Edit: I am using the Fiddler Application to monitor traffic. I am not connecting to localhost. I am connect to web API's.

编辑:我正在使用 Fiddler 应用程序来监控流量。我没有连接到本地主机。我正在连接到 Web API。

采纳答案by EricLaw

Step #1 is to try starting Fiddler before starting your application. This helps the default configuration, whereby .NET applications pick up the system proxy when they start and are oblivious to proxy changes after they start.

第 1 步是在启动应用程序之前尝试启动 Fiddler。这有助于默认配置,即 .NET 应用程序在启动时选择系统代理,并在启动后忽略代理更改。

Step #2, if the first step doesn't work, is to explicitly configure your process to use the proxy by editing the app.exe.config file or the machine.config file, or by setting the Proxyproperty on the request object.

第 2 步,如果第一步不起作用,则是通过编辑 app.exe.config 文件或 machine.config 文件,或通过设置Proxy请求对象的属性,显式配置您的进程以使用代理。