asp.net.ph

Skip Navigation Links

<securityPolicy> Section

ASP.NET Syntax   ASP.NET Configuration Sections


Defines valid mappings of named security levels to policy files. This section can be declared at the machine, site, and application levels. You can extend this system by providing your own named trustLevel mapped to a file specified by the policyFile attribute.

<securityPolicy>
   <trustLevel
      name = "value"
      policyFile = "value" />
</securityPolicy>

The <securityPolicy> tag supports one subtag.

Attribute Option Description
trustLevel     Specifies a security level name and associated policy file for each security level.

The <trustlevel> subtag supports two attributes.

Attribute Option Description
name     Specifies a name to associate with the specified level of trust.
    Full Sets the Full security level.
    High Sets the High security level.
    Low Sets the Low security level.
    None Indicates policy file mapping for the Full security level.
policyFile     Specifies the policy file ( relative to the install root directory, where the machine.config file is located ) associated with the specified level of trust. The Full trust level is not associated with a policyFile. If the trustLevel is set to Full, the ASP.NET host does not add any extra application domain level policy to an application, and the policyFile attribute is ignored.

Syntax Example

The following example specifies the policy files that handle different trust levels.

<securityPolicy>
   <trustLevel name = "Full" policyFile = "internal" />
   <trustLevel name = "High" policyFile = "web_hightrust.config" />
   <trustLevel name = "Low"  policyFile = "web_lowtrust.config" />
   <trustLevel name = "None" policyFile = "web_notrust.config" />
</securityPolicy>
See Also

ASP.NET Configuration   SecurityPolicySection Class



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note