This documentation is archived and is not being maintained.

partialTrustVisibleAssemblies Element (ASP.NET Settings Schema)

Visual Studio 2010

Configures a set of partial-trust visible assemblies for an application.

<configuration> Element
  system.web Element (ASP.NET Settings Schema)
    partialTrustVisibleAssemblies Element (ASP.NET Settings Schema)
   <add... />
   <remove... />

The following sections describe attributes, child elements, and parent elements.



Child Elements




Optional element.

Adds a reference to a partial-trust visible assembly.


Optional element.

Removes all references to partial-trust visible assemblies.


Optional element.

Removes a reference to a partial-trust visible assembly.

The value must exactly match that of a previous add directive.

Parent Elements




Specifies the required root element in every configuration file that is used by the common language runtime and .NET Framework applications.


Specifies the root element for the ASP.NET configuration section.

The partialTrustVisibleAssemblies section and the related PartialTrustVisibleAssembly type are used for partial-trust scenarios. By default, the following ASP.NET partial-trust assemblies are marked with the conditional Allow Partially Trusted Callers Attribute (APTCA):

  • System.Web.dll

  • System.Web.Extensions.dll

  • System.Web.Abstractions.dll

  • System.Web.DynamicData.dll

  • System.Web.Routing.dll

You can add assemblies to this list by configuring the partialTrustVisibleAssemblies section of the Web.config file.

If you mark an assembly with the conditional APTCA attribute to allow partially trusted callers, and if you want to make the assembly both visible and accessible to partial-trust code in your Web application, you must add a reference to the assembly in the partialTrustVisibleAssemblies section by using the add element. For more information about the APTCA attribute, see the AllowPartiallyTrustedCallersAttribute class.

The following example shows how to add an assembly marked with the APTCA attribute to the partialTrustVisibleAssemblies section. For the publicKey attribute, you must supply the hexadecimal string representation of a public key value. To get the hexadecimal string representation of a public key, use the Strong Name tool (Sn.exe).

      <add assemblyName = "My.Assembly" 
           version = "2.0.0"
           publicKey = "hex_key_representation"/>