Rediger

Del via


AppDomainSetup.PartialTrustVisibleAssemblies Property

Definition

Gets or sets a list of assemblies marked with the NotVisibleByDefault flag that are made visible to partial-trust code running in a sandboxed application domain.

public:
 property cli::array <System::String ^> ^ PartialTrustVisibleAssemblies { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
public string[] PartialTrustVisibleAssemblies { get; set; }
member this.PartialTrustVisibleAssemblies : string[] with get, set
Public Property PartialTrustVisibleAssemblies As String()

Property Value

String[]

An array of partial assembly names, where each partial name consists of the simple assembly name and the public key.

Remarks

Beginning with the .NET Framework 4, the AllowPartiallyTrustedCallersAttribute (APTCA) attribute can be made conditional by setting its PartialTrustVisibilityLevel property to NotVisibleByDefault. An APTCA assembly that is marked with NotVisibleByDefault cannot be used by partially trusted code unless the host application allows it.

The host of a sandboxed application domain allows code in the application domain to use assemblies with conditional APTCA attributes by creating an array that contains the simple name and public key of each assembly, and assigning the array to this property. For example, an element of the array might look like the following: "MyAssembly, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db2ad5e5fedc67ea526ff72ad426ef68e08e241d296c499eedfec6648dcc62b1a12f72be5833a45bbec481b68415b08a5fbc9f9ef247b523dd72bbea65bb532784ddc5c704544bd2f1c2d46fdbe41e4f949e76f9947357b2d5cf8ca9f970701bbd6e8ab64ad31b20ad0be9b56dae4f6b83332b92a2a3b8ea2804c40efbc0b6b9".

Important

If you are using a subclass of AppDomainManager, and the assembly that defines it depends on assemblies that are marked with the conditional APTCA attribute, you must include those assemblies in the list that you pass to the PartialTrustVisibleAssemblies property of the AppDomainSetup you use to create application domains. Otherwise the assemblies that are marked with the conditional APTCA attribute will be disabled.

Note

When you are debugging an application that is running in a sandboxed application domain, some SecurityException messages can be misleading. For example, a message might state that one of your fully trusted assemblies has only limited permissions, when the real cause of the problem is that a security demand that exceeds the grant set of the sandboxed application domain has propagated to the boundary of the sandboxed application domain and failed.

Applies to

See also