Export (0) Print
Expand All
Expand Minimize

<trust> Element

Configures the code access security level applied to an application. The <trust> section can be declared at the machine, site, and application levels.

<configuration>
   <system.web>
      <trust>

<trust level="Full|High|Medium|Low|Minimal" originUrl="url"/>

Required Attribute

Attribute Option Description
level     Specifies the security zone under which the application will be run. The default is Full. The named levels correspond to the security levels defined in <trustLevel>.
    Full Specifies that ASP.NET does not restrict security policy.
    High Specifies that the High level is applied to code access security.
    Medium Specifies that the Medium level is applied to code access security.
    Low Specifies that the Low level is applied to code access security.
    Minimal Specifies that the Minimal level is applied to code access security.

Optional Attribute

Attribute Description
originUrl Specifies an application's URL of origin. If present, this can be used for some permissions such as WebRequest that allow connectivity back to the host of origin. This allows permissions that rely on the notion of a host to function correctly.

Example

The following example specifies trust level settings for an ASP.NET application.

<system.web>
   <trust level="Full" originUrl=""/>
</system.web>

Requirements

Contained Within: <system.web>

Web Platform: IIS 5.0, IIS 5.1, IIS 6.0

Configuration File: Machine.config, Web.config

Configuration Section Handler: System.Web.Security.CodeAccessSecurityHandler

See Also

ASP.NET Configuration | ASP.NET Settings Schema

Show:
© 2014 Microsoft