共用方式為


RuntimeCompatibilityAttribute 建構函式

定義

初始化 RuntimeCompatibilityAttribute 類別的新執行個體。

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

範例

下列程式代碼範例會將 RuntimeCompatibilityAttribute 屬性套用至元件,以停用例外狀況包裝。

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

適用於