Share via


RuntimeCompatibilityAttribute.WrapNonExceptionThrows Properti

Definisi

Mendapatkan atau menetapkan nilai yang menunjukkan apakah akan membungkus pengecualian yang tidak berasal dari Exception kelas dengan RuntimeWrappedException objek .

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

Nilai Properti

true jika pengecualian yang tidak berasal dari Exception kelas akan muncul dibungkus dengan RuntimeWrappedException objek; jika tidak, false.

Contoh

Contoh kode berikut menerapkan atribut ke RuntimeCompatibilityAttribute assembly untuk menonaktifkan pembungkusan pengecualian.

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

Berlaku untuk