ReliabilityContractAttribute クラス
この記事の内容
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
注意事項
The Constrained Execution Region (CER) feature is not supported.
一部のコードの作成者とそのコードに依存している開発者の間の信頼性のコントラクトを定義します。
public ref class ReliabilityContractAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
[System.Obsolete("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId="SYSLIB0004", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class ReliabilityContractAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed class ReliabilityContractAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)>]
[<System.Obsolete("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId="SYSLIB0004", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type ReliabilityContractAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)>]
type ReliabilityContractAttribute = class
inherit Attribute
Public NotInheritable Class ReliabilityContractAttribute
Inherits Attribute
- 継承
- 属性
次のコード例では、 属性を使用してアセンブリの ReliabilityContractAttribute 信頼性レベルを文書化する方法を示します。
using namespace System;
using namespace System::Runtime::ConstrainedExecution;
[assembly:ReliabilityContractAttribute(
Consistency::MayCorruptInstance, Cer::None)];
namespace ReliabilityLibrary
{
class SomeClass {};
}
using System;
using System.Runtime.ConstrainedExecution;
[assembly:ReliabilityContractAttribute(
Consistency.MayCorruptInstance, Cer.None)]
namespace ReliabilityLibrary
{
class SomeClass {}
}
Imports System.Runtime.ConstrainedExecution
<assembly:ReliabilityContractAttribute( _
Consistency.MayCorruptInstance, Cer.None)>
Namespace ReliabilityLibrary
Class SomeClass
End Class
End Namespace
属性は ReliabilityContractAttribute 、コードを文書化するためのメカニズムを提供し、不整合な状態になる可能性がある例外的な条件に直面してどのような種類の信頼性保証を行うことができるかを示します。 このコンテキストでは、例外条件は、中止されたスレッド、メモリ不足の状況、スタック オーバーフローなど、共通言語ランタイムによって実行時に生成できる非同期例外として定義されます。 属性は ReliabilityContractAttribute 、アセンブリ、型、およびメソッドに適用できます。
この属性を 列挙体と共に Consistency 使用して、特定のコードの信頼性レベルを文書化することによって信頼性コントラクトを定義します。
Reliability |
古い.
指定した Consistency 保証と Cer 値を使用して、ReliabilityContractAttribute クラスの新しいインスタンスを初期化します。 |
Cer |
古い.
制約された実行領域 (CER) 下で呼び出されたときに、メソッド、型、またはアセンブリの動作を決定する値を取得します。 |
Consistency |
古い.
Consistency の信頼性のコントラクトの値を取得します。 |
Type |
古い.
派生クラスで実装されると、この Attribute の一意の識別子を取得します。 (継承元 Attribute) |
Equals(Object) |
古い.
このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。 (継承元 Attribute) |
Get |
古い.
このインスタンスのハッシュ コードを返します。 (継承元 Attribute) |
Get |
古い.
現在のインスタンスの Type を取得します。 (継承元 Object) |
Is |
古い.
派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。 (継承元 Attribute) |
Match(Object) |
古い.
派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (継承元 Attribute) |
Memberwise |
古い.
現在の Object の簡易コピーを作成します。 (継承元 Object) |
To |
古い.
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
_Attribute. |
古い.
一連の名前を対応する一連のディスパッチ識別子に割り当てます。 (継承元 Attribute) |
_Attribute. |
古い.
オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。 (継承元 Attribute) |
_Attribute. |
古い.
オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。 (継承元 Attribute) |
_Attribute. |
古い.
オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。 (継承元 Attribute) |
製品 | バージョン (廃止) |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1 (5, 6, 7, 8, 9) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |