RuntimeCompatibilityAttribute.WrapNonExceptionThrows Proprietà

Definizione

Ottiene o imposta un valore che indica se incapsulare le eccezioni che non derivano dalla classe Exception con un oggetto 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

Valore della proprietà

Boolean

true se le eccezioni che non derivano dalla classe Exception devono apparire incapsulate con un oggetto RuntimeWrappedException; in caso contrario false.

Esempio

Nell'esempio di codice seguente l'attributo viene applicato a un assembly per disabilitare il RuntimeCompatibilityAttribute wrapping delle eccezioni.

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;
}

Si applica a