RuntimeCompatibilityAttribute.WrapNonExceptionThrows プロパティ

定義

Exception クラスから派生していない例外を RuntimeWrappedException オブジェクトでラップするかどうかを指定する値を取得または設定します。

public:
 property bool WrapNonExceptionThrows { bool get(); void set(bool value); };
public bool WrapNonExceptionThrows { get; set; }
member this.WrapNonExceptionThrows : bool with get, set
Public Property WrapNonExceptionThrows As Boolean

プロパティ値

Exception クラスから派生していない例外を RuntimeWrappedException オブジェクトでラップする場合は true。それ以外の場合は false

次のコード例では、 属性を RuntimeCompatibilityAttribute アセンブリに適用して、例外の折り返しを無効にします。

using namespace System;
using namespace System::Runtime::CompilerServices;

[assembly:RuntimeCompatibilityAttribute(WrapNonExceptionThrows = false)];

void run()
{
     Console::WriteLine("The RuntimeCompatibilityAttribute was applied to disable exception wrapping.");
}

int main()
{
    run();

    return 0;
}

適用対象