This documentation is archived and is not being maintained.

PartialTrustVisibilityLevel Enumeration

Specifies the default partial-trust visibility for code that is marked with the AllowPartiallyTrustedCallersAttribute (APTCA) attribute.

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

public enum PartialTrustVisibilityLevel

Member nameDescription
VisibleToAllHostsThe assembly can always be called by partial-trust code.
NotVisibleByDefaultThe assembly has been audited for partial trust, but it is not visible to partial-trust code in all hosts. To make the assembly visible to partial-trust code, add it to the AppDomainSetup.PartialTrustVisibleAssemblies property.

PartialTrustVisibilityLevel is passed as a property setting parameter to the AllowPartiallyTrustedCallersAttribute.AllowPartiallyTrustedCallersAttribute constructor. If no parameter is passed to the constructor, the default is VisibleToAllHosts.

You enable partially trusted assemblies that are identified as NotVisibleByDefault by adding them to the PartialTrustVisibleAssemblies property of their application domain. If you enable an assembly that references (directly or indirectly) other partially trusted assemblies that are NotVisibleByDefault, those other assemblies should be enabled as well.

When an APTCA library that specifies a PartialTrustVisibilityLevel and that is eligible for code sharing is loaded for the first time, it is loaded into the shared domain. Whenever that assembly is loaded with the same PartialTrustVisibilityLevel into another domain, it will be shared. However, if the assembly is loaded with a different PartialTrustVisibilityLevel, it will not be shared.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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