mscorlib(4.0.0.0) API with additions
System.Runtime.ConstrainedExecution Namespace Reference

Classes

class  CriticalFinalizerObject
 Ensures that all finalization code in derived classes is marked as critical. More...
 
class  PrePrepareMethodAttribute
 Instructs the native image generation service to prepare a method for inclusion in a constrained execution region (CER). More...
 
class  ReliabilityContractAttribute
 Defines a contract for reliability between the author of some code, and the developers who have a dependency on that code. More...
 

Enumerations

enum  Cer { Cer.None, Cer.MayFail, Cer.Success }
 Specifies a method's behavior when called within a constrained execution region. More...
 
enum  Consistency { Consistency.MayCorruptProcess, Consistency.MayCorruptAppDomain, Consistency.MayCorruptInstance, Consistency.WillNotCorruptState }
 Specifies a reliability contract. More...
 

Enumeration Type Documentation

◆ Cer

Specifies a method's behavior when called within a constrained execution region.

Enumerator
None 

The method, type, or assembly has no concept of a CER. It does not take advantage of CER guarantees. This implies the following:

MayFail 

In the face of exceptional conditions, the method might fail. In this case, the method will report back to the calling method whether it succeeded or failed. The method must have a CER around the method body to ensure that it can report the return value.

Success 

In the face of exceptional conditions, the method is guaranteed to succeed. You should always construct a CER around the method that is called, even when it is called from within a non-CER region. A method is successful if it accomplishes what is intended. For example, marking P:System.Collections.ArrayList.Count with ReliabilityContractAttribute(Cer.Success) implies that when it is run under a CER, it always returns a count of the number of elements in the T:System.Collections.ArrayList and it can never leave the internal fields in an undetermined state.

Definition at line 5 of file Cer.cs.

◆ Consistency

Specifies a reliability contract.

Enumerator
MayCorruptProcess 

In the face of exceptional conditions, the CLR makes no guarantees regarding state consistency; that is, the condition might corrupt the process.

MayCorruptAppDomain 

In the face of exceptional conditions, the common language runtime (CLR) makes no guarantees regarding state consistency in the current application domain.

MayCorruptInstance 

In the face of exceptional conditions, the method is guaranteed to limit state corruption to the current instance.

WillNotCorruptState 

In the face of exceptional conditions, the method is guaranteed not to corrupt state.

Definition at line 5 of file Consistency.cs.