Bagikan melalui


RuntimeCompatibilityAttribute Konstruktor

Definisi

Menginisialisasi instans baru kelas RuntimeCompatibilityAttribute.

public:
 RuntimeCompatibilityAttribute();
public RuntimeCompatibilityAttribute ();
Public Sub New ()

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