This documentation is archived and is not being maintained.

_AppDomain.SetAppDomainPolicy Method

Establishes the security policy level for this application domain.

[Visual Basic]
Sub SetAppDomainPolicy( _
   ByVal domainPolicy As PolicyLevel _
)
[C#]
void SetAppDomainPolicy(
   PolicyLevel domainPolicy
);
[C++]
void SetAppDomainPolicy(
   PolicyLevel* domainPolicy
);
[JScript]
function SetAppDomainPolicy(
   domainPolicy : PolicyLevel
);

Parameters

domainPolicy
The security policy level.

Exceptions

Exception Type Condition
ArgumentNullException domainPolicy is a null reference (Nothing in Visual Basic).
PolicyException The security policy level has already been set.

Remarks

Call this method before an assembly is loaded into the AppDomain in order for the security policy to have effect.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

_AppDomain Interface | _AppDomain Members | System Namespace

Show: