RuntimeCompatibilityAttribute.WrapNonExceptionThrows Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta un valore che indica se eseguire il Exception wrapping delle eccezioni che non derivano dalla classe con un RuntimeWrappedException oggetto .
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à
true se le eccezioni che non derivano dalla Exception classe devono essere incluse incapsulate con un RuntimeWrappedException oggetto ; 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;
}