AppDomain.SetAppDomainPolicy(PolicyLevel) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
Establishes the security policy level for this application domain.
public:
virtual void SetAppDomainPolicy(System::Security::Policy::PolicyLevel ^ domainPolicy);
public void SetAppDomainPolicy(System.Security.Policy.PolicyLevel domainPolicy);
[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.")]
[System.Security.SecurityCritical]
public void SetAppDomainPolicy(System.Security.Policy.PolicyLevel domainPolicy);
abstract member SetAppDomainPolicy : System.Security.Policy.PolicyLevel -> unit
override this.SetAppDomainPolicy : System.Security.Policy.PolicyLevel -> unit
[<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.")>]
[<System.Security.SecurityCritical>]
abstract member SetAppDomainPolicy : System.Security.Policy.PolicyLevel -> unit
override this.SetAppDomainPolicy : System.Security.Policy.PolicyLevel -> unit
Public Sub SetAppDomainPolicy (domainPolicy As PolicyLevel)
Parameters
- domainPolicy
- PolicyLevel
The security policy level.
Implements
- Attributes
Exceptions
domainPolicy
is null
.
The security policy level has already been set.
The operation is attempted on an unloaded application domain.
Remarks
Call this method before an assembly is loaded into the AppDomain in order for the security policy to have effect.