Compartir a través de


Error del compilador C3094

'attribute': uso anónimo no permitido.

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

Ejemplo

El ejemplo siguiente genera la advertencia 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{};