Main Page

  Previous Section Next Section

AspNetHostingPermissionAttribute.NET 1.1, serializable

System.Web (system.dll)sealed class

With this attribute, you can ensure that the current assembly has the required code access security permission to host the ASP.NET engine. If it does not, a System.Security.SecurityException will be thrown immediately (which prevents the problem of an unexpected security-related failure later on). This attribute serves the same purpose as the AspNetHostingPermission class. The difference is that while AspNetHostingPermission must be used programmatically (by creating an instance and invoking the corresponding method), AspNetHostingPermissionAttribute is used declaratively, by adding the attribute to an assembly or code construct like a class or method declaration.

Note that this type only pertains to code access security (the policy of allowed and disallowed actions configured using the .NET Framework Configuration Tool or the caspol.exe command-line utility). It has nothing to do with ASP.NET or IIS authentication. It will also not be of any interest if you are using IIS to host the ASP.NET engine.

public sealed class AspNetHostingPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute {
// Public Constructors
   public AspNetHostingPermissionAttribute(System.Security.Permissions.SecurityAction action);
// Public Instance Properties
   public AspNetHostingPermissionLevel Level{set; get; }
// Public Instance Methods
   public override IPermission CreatePermission( );  // overrides System.Security.Permissions.SecurityAttribute


System.Object System.Attribute System.Security.Permissions.SecurityAttribute System.Security.Permissions.CodeAccessSecurityAttribute AspNetHostingPermissionAttribute

Valid On


      Previous Section Next Section