Permalink
Fetching contributors…
Cannot retrieve contributors at this time
92 lines (75 sloc) 3.19 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
<performanceCounter> Element (Network Settings)
03/30/2017
.net-framework
dotnet-clr
article
VB
CSharp
C++
jsharp
performanceCounter element
<performanceCounter> element
3afa1586-e1b8-473d-8985-c3fc90cf561b
11
mcleblanc
markl
markl

<performanceCounter> Element (Network Settings)

Enables or disables networking performance counters.

<configuration>
<system.net>
<settings>
<performanceCounters>

Syntax

<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 xref: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 xref:System.Net.Configuration.PerformanceCountersElement.Enabled%2A?displayProperty=nameWithType property can be used to get the current value of the enabled attribute from applicable configuration files.

Example

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

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

See Also

xref:System.Net.Configuration.PerformanceCountersElement?displayProperty=nameWithType
xref:System.Net.Configuration.PerformanceCountersElement.Enabled%2A?displayProperty=nameWithType
Network Settings Schema
Networking Performance Counters