編譯器錯誤 C3100
'target' : 未知的屬性限定符
指定了無效的屬性目標。
如需詳細資訊,請參閱 User-Defined Attributes。
範例
下列範例會產生 C3100。
// C3100.cpp
// compile with: /clr /c
using namespace System;
[AttributeUsage(AttributeTargets::All)]
public ref class Attr : public Attribute {
public:
Attr(int t) : m_t(t) {}
int m_t;
};
[invalid_target:Attr(10)]; // C3100
[assembly:Attr(10)]; // OK