.NET Framework 中的网络跟踪Network Tracing in the .NET Framework

.NET Framework 中的网络跟踪允许访问有关方法调用的信息,以及有关托管应用程序所生成的网络流量的信息。Network tracing in the .NET Framework provides access to information about method invocations and network traffic generated by a managed application. 此功能可用于调试正在开发的应用程序,也可用于分析已部署的应用程序。This feature is useful for debugging applications under development as well as for analyzing deployed applications. 可以自定义网络跟踪所提供的输出,以支持在开发时和在生产环境中的不同使用方案。The output provided by network tracing is customizable to support different usage scenarios at development time and in a production environment.

若要启用 .NET Framework 中的网络跟踪,你必须为跟踪输出选择一个目的地,并将网络跟踪配置设置添加到应用程序配置文件或计算机配置文件。To enable network tracing in the .NET Framework, you must select a destination for tracing output and add network tracing configuration settings to either the application or machine configuration file. 有关配置文件及其使用方法的说明,请参阅配置文件For descriptions of configuration files and how they are used, see Configuration Files. 有关如何启用网络跟踪的信息,请参阅启用网络跟踪For information about how to enable network tracing, see Enabling Network Tracing. 有关需要添加到配置文件的设置的信息,请参阅如何:配置网络跟踪For information about the settings that you need to add to the configuration file, see How to: Configure Network Tracing.

启用跟踪后,可捕获由 System.Net 类输出的跟踪信息。When tracing is enabled, you can capture trace information that is output by System.Net classes. 可生成跟踪信息的网络类成员包括其 .NET Framework 类库文档“备注”部分中的以下注释:Networking class members that generate tracing information include the following note in the Remarks section of their NET Framework class library documentation:


当你在应用程序中启用网络跟踪后,此成员将输出跟踪信息。This member outputs trace information when you enable network tracing in your application. 有关详细信息,请参阅“网络跟踪”。For more information, see Network Tracing.

请参阅See also