Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TraceSwitch.OnSwitchSettingChanged Method

Updates and corrects the level for this switch.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)

protected override void OnSwitchSettingChanged()

The OnSwitchSettingChanged method is used by the .NET framework to validate and correct the value of a switch initialized via a configuration file. A message is written to all trace listeners if the switch value specified in the configuration file is not defined by the TraceLevel enumeration and the switch is set to a defined value.

If you attempt in your code to set the Level property to a value that is not defined by the TraceLevel enumeration, an ArgumentException exception is thrown.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft