नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'attribute': attribute must be scoped with 'assembly:' or 'module:'
Remarks
A global attribute was used incorrectly.
For more information, see User-Defined Attributes.
Example
The following example generates C3097.
// C3097.cpp
// compile with: /clr /c
using namespace System;
[AttributeUsage(AttributeTargets::All, AllowMultiple = true)]
public ref class Attr : public Attribute {
public:
Attr(int t) : m_t(t) {}
int m_t;
};
[Attr(10)]; // C3097
[assembly:Attr(10)]; // OK
[Attr(10)] // OK
public ref class MyClass {};