This documentation is archived and is not being maintained.

Compiler Error C3099

Error Message

'keyword': use [System::AttributeUsageAttribute] for managed attributes

Use AttributeUsageAttribute to declare /clr attributes.

For more information, see User-Defined Attributes.


The following sample generates C3099.

// C3099.cpp
// compile with: /clr /c
using namespace System;
[usage(10)]   // C3099
// try the following line instead
// [AttributeUsageAttribute(AttributeTargets::All)]
ref class A : Attribute {};