HostSecurityManager.DomainPolicy Property



This API is now obsolete.

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

 virtual property System::Security::Policy::PolicyLevel ^ DomainPolicy { System::Security::Policy::PolicyLevel ^ get(); };
[System.Obsolete("AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See for more information.")]
public virtual System.Security.Policy.PolicyLevel DomainPolicy { get; }
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.



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.


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.


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

Applies to