GacIdentityPermission Constructors

Definition

Initializes a new instance of the GacIdentityPermission class.

Overloads

GacIdentityPermission()

Initializes a new instance of the GacIdentityPermission class.

GacIdentityPermission(PermissionState)

Initializes a new instance of the GacIdentityPermission class with fully restricted PermissionState.

GacIdentityPermission()

Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs

Initializes a new instance of the GacIdentityPermission class.

public GacIdentityPermission ();

Examples

The following code example shows the use of the GacIdentityPermission() constructor.

GacIdentityPermission Gac1 = new GacIdentityPermission();
GacIdentityPermission Gac2 = new GacIdentityPermission(PermissionState.None);
if (Gac1.Equals(Gac2))
    Console.WriteLine("GacIdentityPermission() equals GacIdentityPermission(PermissionState.None).");

Remarks

This constructor creates a GacIdentityPermission with a PermissionState value of None.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GacIdentityPermission(PermissionState)

Source:
GacIdentityPermission.cs
Source:
GacIdentityPermission.cs

Initializes a new instance of the GacIdentityPermission class with fully restricted PermissionState.

public GacIdentityPermission (System.Security.Permissions.PermissionState state);

Parameters

state
PermissionState

One of the PermissionState values.

Exceptions

state is not a valid PermissionState value.

Examples

The following code example shows the use of the GacIdentityPermission.GacIdentityPermission(PermissionState) constructor.

GacIdentityPermission Gac1 = new GacIdentityPermission(PermissionState.None);

Remarks

Note

In the .NET Framework versions 1.0 and 1.1, identity permissions cannot have an Unrestricted permission state value. Starting with the .NET Framework version 2.0, identity permissions can have any permission state value. This means that in 2.0 and later versions, identity permissions have the same behavior as permissions that implement the IUnrestrictedPermission interface.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9