共用方式為


編譯器錯誤 C3454

類別宣告上不允許 [attribute]

備註

必須定義類別,它才能是屬性。

如需詳細資訊,請參閱 屬性

範例

下列範例會產生 C3454。

// C3454.cpp
// compile with: /clr /c
using namespace System;

[attribute]   // C3454
ref class Attr1;

[attribute]   // OK
ref class Attr2 {};