Export (0) Print
Expand All

AllowPartiallyTrustedCallersAttribute.PartialTrustVisibilityLevel Property

Gets or sets the default partial trust visibility for code that is marked with the AllowPartiallyTrustedCallersAttribute (APTCA) attribute.

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

public PartialTrustVisibilityLevel PartialTrustVisibilityLevel { get; set; }

Property Value

Type: System.Security.PartialTrustVisibilityLevel
One of the enumeration values. The default is VisibleToAllHosts.

The following examples demonstrate how to use this property.

  • Default, unconditional APTCA:

    [assembly: AllowPartiallyTrustedCallers]
    

    Defaults to VisibleToAllHosts.

  • Explicit, unconditional APTCA:

    [assembly: AllowPartiallyTrustedCallers(PartialTrustVisibilityLevel=VisibleToAllHosts)]
    

    The assembly can always be called by partial-trust code.

  • Explicit, conditional APTCA:

    [assembly: AllowPartiallyTrustedCallers(PartialTrustVisibilityLevel=NotVisibleByDefault)]
    

    The assembly has been audited for partial trust, but it is not visible to partial-trust code by default. To make the assembly visible to partial-trust code, add it to the AppDomainSetup.PartialTrustVisibleAssemblies property.

.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.

Community Additions

ADD
Show:
© 2014 Microsoft