AppDomain.IsCompatibilitySwitchSet Method

Gets a nullable Boolean value that indicates whether any compatibility switches are set, and if so, whether the specified compatibility switch is set.

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

member IsCompatibilitySwitchSet : 
        value:string -> Nullable<bool> 

Parameters

value
Type: System.String

The compatibility switch to test.

Return Value

Type: System.Nullable(Boolean)
A null reference (Nothing in Visual Basic) if no compatibility switches are set; otherwise, a Boolean value that indicates whether the compatibility switch that is specified by value is set.

This method tests whether the current application domain reverses breaking changes that were introduced in the .NET Framework 4. The following table provides examples of compatibility switches that can be set to restore the behavior of earlier versions of the .NET Framework.

Switch

Meaning

"NetFx40_LegacySecurityPolicy"

Code access security (CAS) for the .NET Framework 3.5 is enabled in this application domain. See <NetFx40_LegacySecurityPolicy> Element.

"NetFx40_Legacy20SortingBehavior"

String sorting defaults for the .NET Framework 3.5 are enabled in this application domain. Its success requires sort00001000.dll to be installed.

"NetFx40_Legacy40SortingBehavior"

String sorting defaults for the .NET Framework 4 and Unicode 5.0 are enabled in this application domain. Its success requires sort00060101.dll to be installed.

"NetFx40_TimeSpanLegacyFormatMode"

TimeSpan formatting behavior for the .NET Framework 3.5 is enabled in this application domain.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft