नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'argument': not a valid named attribute argument
Remarks
In order for an attribute class data member to be a valid named argument, it must not be marked static, const, or literal. If a property, the property must not be static and must have get and set accessors.
For more information, see property and User-Defined Attributes.
Example
The following example generates C3114.
// C3114.cpp
// compile with: /clr /c
public ref class A : System::Attribute {
public:
static property int StaticProp {
int get();
}
property int Prop2 {
int get();
void set(int i);
}
};
[A(StaticProp=123)] // C3114
public ref class R {};
[A(Prop2=123)] // OK
public ref class S {};