mscorlib 2.0.0.0 4.0.0.0 System.Security.Permissions.CodeAccessSecurityAttribute System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Delegate | System.AttributeTargets.All, AllowMultiple=true, Inherited=false) System.Runtime.InteropServices.ComVisible(true)

This attribute affects only unmanaged applications that host the common language runtime and implement host protection, such as SQL Server. If the code is run in a client application or on a server that is not host-protected, the attribute "evaporates"; it is not detected and therefore not applied. When applied, the security action results in the creation of a link demand based on the host resources the class or method exposes.

The purpose of this attribute is to enforce host-specific programming model guidelines, not security behavior. Although a link demand is used to check for conformance to programming model requirements, the is not a security permission.

If the host does not have programming model requirements, the link demands do not occur.

This attribute identifies the following:

Methods or classes that do not fit the host programming model, but are otherwise benign.

Methods or classes that do not fit the host programming model and could lead to destabilizing server-managed user code.

Methods or classes that do not fit the host programming model and could lead to a destabilization of the server process itself.

If you are creating a class library that is to be called by applications that may execute in a host protected environment, you should apply this attribute to members that expose resource categories. The .NET Framework class library members with this attribute cause only the immediate caller to be checked. Your library member must also cause a check of its immediate caller in the same manner.

Do not use the Native Image Generator (Ngen.exe) to create a native image of assemblies that are protected by the . In a full-trust environment, the image is always loaded, without regard to the , and in a partial-trust environment the image is not loaded.

Allows the use of declarative security actions to determine host protection requirements. This class cannot be inherited.

- Constructor
  2.0.0.0
  4.0.0.0

  This constructor creates a with all Boolean properties set to false.

  Initializes a new instance of the class with default values.

- Constructor
  2.0.0.0
  4.0.0.0

  This constructor should not be used. It is intended for infrastructure use.

  Initializes a new instance of the class with the specified value.

  One of the values.
- Method
  2.0.0.0
  4.0.0.0
  System.Security.IPermission

  This method should be called only by the security system, never by application code.

  At compile time, attributes convert security declarations to a serialized form in metadata. Declarative security data in metadata is created from the permission corresponding to the attribute that this method returns.

  Creates and returns a new host protection permission.

  An that corresponds to the current attribute.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  Code that exposes external process management might create or destroy other processes.

  Gets or sets a value indicating whether external process management is exposed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  Code that exposes external threading creates or manipulates threads other than its own, which might be harmful to the host.

  Gets or sets a value indicating whether external threading is exposed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  Code might cause a resource leak on termination, if not protected by a safe handle or some other means of ensuring the release of resources.

  Gets or sets a value indicating whether resources might leak memory if the operation is terminated.

- Property
  2.0.0.0
  4.0.0.0
  System.Security.Permissions.HostProtectionResource To be added.

  The flags specify the resources exposed by the method or class that are potentially harmful to the host.

  Gets or sets flags specifying categories of functionality that are potentially harmful to the host.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Boolean To be added.

  The use of a object to impersonate a user is an example of exposing the security infrastructure.

  Gets or sets a value indicating whether the security infrastructure is exposed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  Self-affecting process management code might exit the current process, terminating the server.

  Gets or sets a value indicating whether self-affecting process management is exposed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  Self-affecting threading manipulates threads in a way that only affects user code.

  Gets or sets a value indicating whether self-affecting threading is exposed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  When is true, it indicates that a state is exposed that might be shared between threads.

  Gets or sets a value indicating whether shared state is exposed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  Gets or sets a value indicating whether synchronization is exposed.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

  Gets or sets a value indicating whether the user interface is exposed.