Compiler Error C3094
'attribute': anonymous usage not allowed
An attribute was not scoped correctly. For more information, see User-Defined Attributes.
Example
The following sample generates 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{};
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for