Share via


RuntimeCompatibilityAttribute.WrapNonExceptionThrows Özellik

Tanım

Sınıfından türetilmeyen Exception özel durumları bir nesneyle sarmalayıp sarmalamayacağını belirten bir RuntimeWrappedException değer alır veya ayarlar.

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

Özellik Değeri

true sınıfından türetilmeyen Exception özel durumlar bir RuntimeWrappedException nesneyle sarmalanmış olarak görünmelidir; aksi takdirde, false.

Örnekler

Aşağıdaki kod örneği, özel durum sarmalama özelliğini devre dışı bırakmak için özniteliğini bir derlemeye uygular 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;
}

Şunlara uygulanır