Share via


<performanceCounter> Element (Network Settings)

Enables or disables networking performance counters.

<configuration> Element
  <system.net> Element (Network Settings)
    <settings> Element (Network Settings)
      <performanceCounter> Element (Network Settings)

<performanceCounters
  enabled="true|false"
/>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

enabled

Specifies whether the networking performance counters are enabled. The default value is false.

Child Elements

None.

Parent Elements

Element

Description

<settings>

Configures basic network options for the System.Net namespace.

Remarks

This element can be used in the application configuration file or the machine configuration file (Machine.config).

Networking performance counters need to be enabled in the configuration file to be used. All networking performance counters are enabled or disabled with a single setting in the configuration file. Individual networking performance counters cannot be enabled or disabled. For more information on the specific networking performance counters, see Networking Performance Counters.

The default value is that networking performance counters are disabled.

The PerformanceCountersElement.Enabled property can be used to get the current value of the enabled attribute from applicable configuration files.

Example

The following code example shows how to configure the System.Net and related namespaces to enable networking performance counters.

<configuration>
  <system.net>
    <settings>
      <performanceCounters
        enabled="true"
      />
    </settings>
  </system.net>
</configuration>

See Also

Reference

Network Settings Schema

Networking Performance Counters

System.Net.Configuration.PerformanceCountersElement

PerformanceCountersElement.Enabled