HostProtectionException コンストラクター
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
HostProtectionException クラスの新しいインスタンスを初期化します。
オーバーロード
| 名前 | 説明 |
|---|---|
| HostProtectionException() |
既定値を使用して、HostProtectionException クラスの新しいインスタンスを初期化します。 |
| HostProtectionException(String) |
指定したエラー メッセージを使用して、 HostProtectionException クラスの新しいインスタンスを初期化します。 |
| HostProtectionException(SerializationInfo, StreamingContext) |
古い.
指定されたシリアル化情報とストリーミング コンテキストを使用して、 HostProtectionException クラスの新しいインスタンスを初期化します。 |
| HostProtectionException(String, Exception) |
指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、HostProtectionException クラスの新しいインスタンスを初期化します。 |
| HostProtectionException(String, HostProtectionResource, HostProtectionResource) |
指定したエラー メッセージ、保護されたホスト リソース、および例外がスローされる原因となったホスト リソースを使用して、 HostProtectionException クラスの新しいインスタンスを初期化します。 |
HostProtectionException()
既定値を使用して、HostProtectionException クラスの新しいインスタンスを初期化します。
public:
HostProtectionException();
public HostProtectionException();
Public Sub New ()
注釈
次の表に、 HostProtectionException クラスのインスタンスの初期プロパティ値を示します。
| 財産 | 価値 |
|---|---|
| ProtectedResources | HostProtectionResource.None |
| DemandedResources | HostProtectionResource.None |
適用対象
HostProtectionException(String)
指定したエラー メッセージを使用して、 HostProtectionException クラスの新しいインスタンスを初期化します。
public:
HostProtectionException(System::String ^ message);
public HostProtectionException(string message);
new System.Security.HostProtectionException : string -> System.Security.HostProtectionException
Public Sub New (message As String)
パラメーター
- message
- String
エラーを説明するメッセージ。
注釈
message パラメーターの内容は、ユーザーが理解できる必要があります。 このコンストラクターの呼び出し元は、この文字列が現在のシステム カルチャ用にローカライズされていることを確認する必要があります。
適用対象
HostProtectionException(SerializationInfo, StreamingContext)
注意事項
This API supports obsolete formatter-based serialization. It should not be called or extended by application code.
指定されたシリアル化情報とストリーミング コンテキストを使用して、 HostProtectionException クラスの新しいインスタンスを初期化します。
protected:
HostProtectionException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected HostProtectionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected HostProtectionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.HostProtectionException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.HostProtectionException
new System.Security.HostProtectionException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.HostProtectionException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
パラメーター
- info
- SerializationInfo
シリアル化されたオブジェクト データを保持するオブジェクト。
- context
- StreamingContext
ソースまたは変換先に関するコンテキスト情報。
- 属性
例外
info は nullです。
注釈
このコンストラクターは、ストリーム経由で送信される例外オブジェクトを再構築するために、逆シリアル化中に呼び出されます。
適用対象
HostProtectionException(String, Exception)
指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、HostProtectionException クラスの新しいインスタンスを初期化します。
public:
HostProtectionException(System::String ^ message, Exception ^ e);
public HostProtectionException(string message, Exception e);
new System.Security.HostProtectionException : string * Exception -> System.Security.HostProtectionException
Public Sub New (message As String, e As Exception)
パラメーター
- message
- String
例外の理由を説明するエラー メッセージ。
現在の例外の原因である例外。
innerException パラメーターが nullされていない場合、内部例外を処理する catch ブロックで現在の例外が発生します。
注釈
前の例外の直接の結果としてスローされる例外は、 InnerException プロパティに前の例外への参照を含めることができます。
InnerException プロパティは、コンストラクターに渡されるのと同じ値を返します。または、null プロパティがコンストラクターに内部例外値を提供しない場合はInnerExceptionします。
適用対象
HostProtectionException(String, HostProtectionResource, HostProtectionResource)
指定したエラー メッセージ、保護されたホスト リソース、および例外がスローされる原因となったホスト リソースを使用して、 HostProtectionException クラスの新しいインスタンスを初期化します。
public:
HostProtectionException(System::String ^ message, System::Security::Permissions::HostProtectionResource protectedResources, System::Security::Permissions::HostProtectionResource demandedResources);
public HostProtectionException(string message, System.Security.Permissions.HostProtectionResource protectedResources, System.Security.Permissions.HostProtectionResource demandedResources);
new System.Security.HostProtectionException : string * System.Security.Permissions.HostProtectionResource * System.Security.Permissions.HostProtectionResource -> System.Security.HostProtectionException
Public Sub New (message As String, protectedResources As HostProtectionResource, demandedResources As HostProtectionResource)
パラメーター
- message
- String
例外の理由を説明するエラー メッセージ。
- protectedResources
- HostProtectionResource
部分的に信頼されたコードにアクセスできないホスト リソースを指定する列挙値のビットごとの組み合わせ。
- demandedResources
- HostProtectionResource
要求されたホスト リソースを指定する列挙値のビットごとの組み合わせ。
注釈
demandedResources パラメーターは、例外がスローされる原因となった要求されたホスト保護カテゴリを指定します。 たとえば、メソッドが共有状態を公開することを示す HostProtectionAttribute 属性を持つメソッドがあるとします。 メソッドが呼び出されると、 HostProtectionAttribute は共有状態のリンク要求を実行します。 ホストが共有状態を禁止カテゴリとして設定している場合、HostProtectionExceptionはHostProtectionResource.SharedStateのdemandedResourcesプロパティ値で発生します。