Export (0) Print
Expand All

AppDomainSetup.PartialTrustVisibleAssemblies Property

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.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Property PartialTrustVisibleAssemblies As String()

Property Value

Type: System.String()
An array of partial assembly names, where each partial name consists of the simple assembly name and the public key.

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 noteImportant

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.

NoteNote

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.

.NET Framework

Supported in: 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft