नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'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 {};