Compartir a través de


Error del compilador C3094

'attribute': uso anónimo no permitido.

Observaciones

Un atributo no estaba dirigido correctamente. Para obtener más información, consulte User-Defined Attributes.

Ejemplo

En el ejemplo siguiente se genera 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{};