RuntimeCompatibilityAttribute.WrapNonExceptionThrows Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether to wrap exceptions that do not derive from the Exception class with a RuntimeWrappedException object.
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
Property Value
true
if exceptions that do not derive from the Exception class should appear wrapped with a RuntimeWrappedException object; otherwise, false
.
Examples
The following code example applies the RuntimeCompatibilityAttribute attribute to an assembly to disable exception wrapping.
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;
}