CompatibilityMode Property
Collapse the table of content
Expand the table of content

MachineKeySection::CompatibilityMode Property

Gets or sets a value that specifies whether upgraded encryption methods for view state that were introduced in the .NET Framework version 2.0 Service Pack 2 release are used.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute(L"compatibilityMode", DefaultValue = MachineKeyCompatibilityMode::Framework20SP1)]
property MachineKeyCompatibilityMode CompatibilityMode {
	MachineKeyCompatibilityMode get ();
	void set (MachineKeyCompatibilityMode value);

Property Value

Type: System.Web.Configuration::MachineKeyCompatibilityMode
A value that indicates whether encryption methods that were introduced in the .NET Framework 2.0 SP2 are used.

The following values can be specified for the CompatibilityMode property:

  • Framework20SP1. This value specifies that ASP.NET uses encryption methods that were available in versions of ASP.NET earlier than 2.0 SP2.

  • Framework20SP2. This value specifies that ASP.NET uses upgraded encryption methods. This is the default value. The upgraded encryption methods in the .NET Framework version 2.0 Service Pack 2 and later versions reduce the risk that an attacker can successfully reverse-engineer the DecryptionKey value.

The older encryption method is available in order to maintain backward compatibility. This is useful if individual servers in a Web farm have not been upgraded to .NET Framework 2.0 SP2 or later versions. In that case, all servers in a Web farm should have the CompatibilityMode property set to Framework20SP1. If you are working with only one server, or if all servers have been upgraded to the .NET Framework 2.0 SP2 or later versions, set this property to Framework20SP2.

.NET Framework

Supported in: 4, 3.5 SP1, 3.0 SP2, 2.0 SP2

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

© 2016 Microsoft