Редагувати

Поділитися через


ApplicationTrust Constructors

Definition

Initializes a new instance of the ApplicationTrust class.

Overloads

ApplicationTrust()

Initializes a new instance of the ApplicationTrust class.

ApplicationTrust(ApplicationIdentity)

Initializes a new instance of the ApplicationTrust class with an ApplicationIdentity.

ApplicationTrust(PermissionSet, IEnumerable<StrongName>)
Obsolete.

Initializes a new instance of the ApplicationTrust class using the provided grant set and collection of full-trust assemblies.

ApplicationTrust()

Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs

Initializes a new instance of the ApplicationTrust class.

public:
 ApplicationTrust();
public ApplicationTrust ();
Public Sub New ()

Remarks

This constructor creates an empty ApplicationTrust object.

Applies to

ApplicationTrust(ApplicationIdentity)

Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs

Initializes a new instance of the ApplicationTrust class with an ApplicationIdentity.

public:
 ApplicationTrust(ApplicationIdentity ^ identity);
public:
 ApplicationTrust(ApplicationIdentity ^ applicationIdentity);
public ApplicationTrust (ApplicationIdentity identity);
public ApplicationTrust (ApplicationIdentity applicationIdentity);
new System.Security.Policy.ApplicationTrust : ApplicationIdentity -> System.Security.Policy.ApplicationTrust
new System.Security.Policy.ApplicationTrust : ApplicationIdentity -> System.Security.Policy.ApplicationTrust
Public Sub New (identity As ApplicationIdentity)
Public Sub New (applicationIdentity As ApplicationIdentity)

Parameters

identityapplicationIdentity
ApplicationIdentity

An ApplicationIdentity that uniquely identifies an application.

Remarks

An application identity contains the full name of the application and the location of its code base.

Applies to

ApplicationTrust(PermissionSet, IEnumerable<StrongName>)

Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs
Source:
ApplicationTrust.cs

Caution

Code Access Security is not supported or honored by the runtime.

Initializes a new instance of the ApplicationTrust class using the provided grant set and collection of full-trust assemblies.

public:
 ApplicationTrust(System::Security::PermissionSet ^ defaultGrantSet, System::Collections::Generic::IEnumerable<System::Security::Policy::StrongName ^> ^ fullTrustAssemblies);
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public ApplicationTrust (System.Security.PermissionSet defaultGrantSet, System.Collections.Generic.IEnumerable<System.Security.Policy.StrongName> fullTrustAssemblies);
public ApplicationTrust (System.Security.PermissionSet defaultGrantSet, System.Collections.Generic.IEnumerable<System.Security.Policy.StrongName> fullTrustAssemblies);
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Policy.ApplicationTrust : System.Security.PermissionSet * seq<System.Security.Policy.StrongName> -> System.Security.Policy.ApplicationTrust
new System.Security.Policy.ApplicationTrust : System.Security.PermissionSet * seq<System.Security.Policy.StrongName> -> System.Security.Policy.ApplicationTrust
Public Sub New (defaultGrantSet As PermissionSet, fullTrustAssemblies As IEnumerable(Of StrongName))

Parameters

defaultGrantSet
PermissionSet

A default permission set that is granted to all assemblies that do not have specific grants.

fullTrustAssemblies
IEnumerable<StrongName>

An array of strong names that represent assemblies that should be considered fully trusted in an application domain.

Attributes

Exceptions

fullTrustAssemblies is null.

fullTrustAssemblies contains an assembly that does not have a StrongName.

Remarks

Caution

Code Access Security (CAS) has been deprecated across all versions of .NET Framework and .NET. Recent versions of .NET do not honor CAS annotations and produce errors if CAS-related APIs are used. Developers should seek alternative means of accomplishing security tasks.

fullTrustAssemblies identifies strong-named assemblies within the AppDomain that are to be granted full trust. This constructor is called by the AppDomain.CreateDomain method to create an AppDomain that will be used as a sandbox. For more information about running an application in a sandbox, see How to: Run Partially Trusted Code in a Sandbox.

Applies to