Leggere in inglese

Condividi tramite


Errore del compilatore C3094

'attribute': uso anonimo non consentito

Un ambito dell'attributo non è stato specificato correttamente. Per altre informazioni, vedere User-Defined Attributes.

Esempio

L'esempio seguente genera l'errore 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{};