共用方式為


編譯器錯誤 C3094

「屬性」:不允許匿名使用

未正確設定屬性的範圍。 如需詳細資訊,請參閱 User-Defined Attributes

範例

下列範例會產生 C3094。

// C3094.cpp
// compile with: /clr /c
using namespace System;
[AttributeUsage(AttributeTargets::Class)]
public ref class AAttribute : Attribute {};

[A];   // C3094

// OK
[A]
ref class x{};