編輯

共用方式為


HostSecurityManager.DomainPolicy Property

Definition

Caution

AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

When overridden in a derived class, gets the security policy for the current application domain.

public:
 virtual property System::Security::Policy::PolicyLevel ^ DomainPolicy { System::Security::Policy::PolicyLevel ^ get(); };
public virtual System.Security.Policy.PolicyLevel DomainPolicy { get; }
[System.Obsolete("AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public virtual System.Security.Policy.PolicyLevel DomainPolicy { get; }
member this.DomainPolicy : System.Security.Policy.PolicyLevel
[<System.Obsolete("AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
member this.DomainPolicy : System.Security.Policy.PolicyLevel
Public Overridable ReadOnly Property DomainPolicy As PolicyLevel

Property Value

The security policy for the current application domain. The default is null.

Attributes

Exceptions

This method uses code access security (CAS) policy, which is obsolete in the .NET Framework 4. To enable CAS policy for compatibility with earlier versions of the .NET Framework, use the <legacyCasPolicy> element.

Remarks

This property can be overridden in a derived class. The base implementation always returns null.

This property is called at AppDomain creation time. It allows a host to supply a policy for the current AppDomain. A policy level consists of the following:

  • A set of code groups organized into a single rooted tree.

  • A set of named permission sets that are referenced by the code groups to specify permissions to be granted to code belonging to the code group.

  • A list of fully trusted assemblies.

Important

See the Notes to Inheritors for the HostSecurityManager class for critical implementation information.

Applies to