Specifies how principal and identity objects should be attached to a thread if the thread attempts to bind to a principal while executing in this application domain.
Assembly: mscorlib (in mscorlib.dll)
[<SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlPrincipal)>] abstract SetPrincipalPolicy : policy:PrincipalPolicy -> unit [<SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlPrincipal)>] override SetPrincipalPolicy : policy:PrincipalPolicy -> unit
The operation is attempted on an unloaded application domain.
Setting this value will only be effective if you set it before using the Thread.CurrentPrincipal property. For example, if you set Thread.CurrentPrincipal to a given principal (for example, a generic principal) and then use the method to set the PrincipalPolicy to WindowsPrincipal, the current principal will remain the generic principal.
The following example shows the effect on threads of using the method to change the principal policy of the application domain. It also shows the effect of using the SetThreadPrincipal method to change the principal that is available for attaching to threads in the application domain.