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

适用于