Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
'keyword': use [System::AttributeUsageAttribute] for managed attributes; use [Windows::Foundation::Metadata::AttributeUsageAttribute] for WinRT attributes
Remarks
Use AttributeUsageAttribute to declare /clr attributes. Use Windows::Foundation::Metadata::AttributeUsageAttribute to declare Windows Runtime attributes.
For more information about /CLR attributes, see User-Defined Attributes. For supported attributes in Windows Runtime, see Windows.Foundation.Metadata namespace
Example
The following example generates C3099 and shows how to fix it.
// C3099.cpp
// compile with: /clr /c
using namespace System;
[usage(10)] // C3099
// try the following line instead
// [AttributeUsageAttribute(AttributeTargets::All)]
ref class A : Attribute {};