PartialTrustVisibilityLevel PartialTrustVisibilityLevel PartialTrustVisibilityLevel PartialTrustVisibilityLevel Enum

定义

指定用 AllowPartiallyTrustedCallersAttribute (APTCA) 特性标记的代码的默认部分信任可见性。Specifies the default partial-trust visibility for code that is marked with the AllowPartiallyTrustedCallersAttribute (APTCA) attribute.

public enum class PartialTrustVisibilityLevel
public enum PartialTrustVisibilityLevel
type PartialTrustVisibilityLevel = 
Public Enum PartialTrustVisibilityLevel
继承
PartialTrustVisibilityLevelPartialTrustVisibilityLevelPartialTrustVisibilityLevelPartialTrustVisibilityLevel

字段

NotVisibleByDefault NotVisibleByDefault NotVisibleByDefault NotVisibleByDefault 1

已为部分信任审核该程序集,但是它在所有主机中对部分信任的代码均不可见。The assembly has been audited for partial trust, but it is not visible to partial-trust code in all hosts. 若要使程序集对部分信任的代码可见,请将该程序集添加到 PartialTrustVisibleAssemblies 属性。To make the assembly visible to partial-trust code, add it to the PartialTrustVisibleAssemblies property.

VisibleToAllHosts VisibleToAllHosts VisibleToAllHosts VisibleToAllHosts 0

程序集始终可以由部分信任的代码调用。The assembly can always be called by partial-trust code.

注解

PartialTrustVisibilityLevel 作为属性设置参数到传递AllowPartiallyTrustedCallersAttribute.AllowPartiallyTrustedCallersAttribute构造函数。PartialTrustVisibilityLevel is passed as a property setting parameter to the AllowPartiallyTrustedCallersAttribute.AllowPartiallyTrustedCallersAttribute constructor. 如果没有参数传递给构造函数,默认值为 VisibleToAllHosts。If no parameter is passed to the constructor, the default is VisibleToAllHosts.

启用部分受信任的程序集添加到标识为 NotVisibleByDefaultPartialTrustVisibleAssemblies其应用程序域的属性。You enable partially trusted assemblies that are identified as NotVisibleByDefault by adding them to the PartialTrustVisibleAssemblies property of their application domain. 如果启用的程序集引用 (直接或间接) 的其他部分受信任程序集是 NotVisibleByDefault,还应启用这些其他程序集。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.

当指定 APTCA 库NotVisibleByDefault和有关代码共享第一次加载,这是符合条件,加载到共享域。When an APTCA library that specifies a NotVisibleByDefault and that is eligible for code sharing is loaded for the first time, it is loaded into the shared domain. 只要该程序集是以相同方式加载PartialTrustVisibilityLevel到另一个域中,它将共享。Whenever that assembly is loaded with the same PartialTrustVisibilityLevel into another domain, it will be shared. 但是,如果程序集以不同方式加载的NotVisibleByDefault,将不会共享。However, if the assembly is loaded with a different NotVisibleByDefault, it will not be shared.

适用于