AppDomainSetup.PartialTrustVisibleAssemblies AppDomainSetup.PartialTrustVisibleAssemblies AppDomainSetup.PartialTrustVisibleAssemblies AppDomainSetup.PartialTrustVisibleAssemblies Property

定义

获取或设置标以 NotVisibleByDefault 标志的程序集的列表,这些程序集对沙箱应用程序域中的部分信任代码可见。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()

属性值

String[]

部分程序集名称的数组,其中每个部分名称都由简单程序集名称和公钥组成。An array of partial assembly names, where each partial name consists of the simple assembly name and the public key.

注解

开头.NET Framework 4.NET Framework 4,则AllowPartiallyTrustedCallersAttribute(APTCA) 特性可为条件通过设置其PartialTrustVisibilityLevel属性设置为NotVisibleByDefaultBeginning with the .NET Framework 4.NET Framework 4, the AllowPartiallyTrustedCallersAttribute (APTCA) attribute can be made conditional by setting its PartialTrustVisibilityLevel property to NotVisibleByDefault. 将标有 APTCA 程序集NotVisibleByDefault除非主机应用程序允许它不能由部分受信任的代码。An APTCA assembly that is marked with NotVisibleByDefault cannot be used by partially trusted code unless the host application allows it.

沙盒应用程序域的主机允许代码在应用程序域使用带有条件 APTCA 特性的程序集,通过创建一个数组,包含的简单名称和公钥的每个程序集,并将该数组分配给此属性。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. 例如,该数组的元素可能看起来如下所示:"MyAssembly,PublicKey =0024000004800000940000000602000000240000525341310004000001000100db2ad5e5fedc67ea526ff72ad426ef68e08e241d296c499eedfec6648dcc62b1a12f72be5833a45bbec481b68415b08a5fbc9f9ef247b523dd72bbea65bb532784ddc5c704544bd2f1c2d46fdbe41e4f949e76f9947357b2d5cf8ca9f970701bbd6e8ab64ad31b20ad0be9b56dae4f6b83332b92a2a3b8ea2804c40efbc0b6b9"。For example, an element of the array might look like the following: "MyAssembly, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db2ad5e5fedc67ea526ff72ad426ef68e08e241d296c499eedfec6648dcc62b1a12f72be5833a45bbec481b68415b08a5fbc9f9ef247b523dd72bbea65bb532784ddc5c704544bd2f1c2d46fdbe41e4f949e76f9947357b2d5cf8ca9f970701bbd6e8ab64ad31b20ad0be9b56dae4f6b83332b92a2a3b8ea2804c40efbc0b6b9".

重要

如果使用的子类AppDomainManager,并将其定义的程序集取决于用条件 APTCA 特性标记的程序集,必须传递到列表中包含这些程序集PartialTrustVisibleAssemblies属性AppDomainSetup用来创建应用程序域。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. 否则,使用条件性 APTCA 特性标记的程序集将被禁用。Otherwise the assemblies that are marked with the conditional APTCA attribute will be disabled.

备注

在调试的应用程序在沙盒应用程序域中,运行时某些SecurityException消息可能会产生误导。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.

适用于

另请参阅