Element Home
This page is specific to:.NET Framework Version:4.0
.NET Framework 4
<NetFx40_LegacySecurityPolicy> Element

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Specifies whether the runtime uses legacy code access security (CAS) policy.

<configuration> Element
  <runtime> Element
    <NetFx40_LegacySecurityPolicy> Element
< NetFx40_LegacySecurityPolicy
   enabled="true|false"/>
Attributes and Elements

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

Attributes

Attribute

Description

enabled

Required attribute.

Specifies whether the runtime uses legacy CAS policy.

enabled Attribute

Value

Description

false

The runtime does not use legacy CAS policy. This is the default.

true

The runtime uses legacy CAS policy.

Child Elements

None.

Parent Elements

Element

Description

configuration

The root element in every configuration file used by the common language runtime and .NET Framework applications.

runtime

Contains information about runtime initialization options.

Remarks

In the .NET Framework version 3.5 and earlier versions, CAS policy is always in effect. In the .NET Framework version 4 Beta 2, CAS policy must be enabled. 

CAS policy is version-specific. Custom CAS policies that exist in earlier versions of the .NET Framework must be respecified in the .NET Framework 4 Beta 2.

NoteNote

If you specify a target .NET Framework version that is earlier than the .NET Framework 4 Beta 2 in the Applications tab for your Visual Studio project, CAS policy will be enabled, including any custom CAS policies you specified for that version. However, you will not be able to use new .NET Framework 4 Beta 2 types and members. You can also specify an earlier version of the .NET Framework by using the <supportedRuntime> element in the startup settings schema.

Configuration File

This element can be used only in the application configuration file.

Example

The following example shows how to enable legacy CAS policy for an application.

<configuration>
   <runtime>
      < NetFx40_LegacySecurityPolicy enabled="true"/>
   </runtime>
</configuration>
See Also

Reference

Other Resources

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View