Compiler Warning (level 1) CS0657
'attribute modifier' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are 'locations'. All attributes in this block will be ignored.
The compiler found an attribute modifier in an invalid location. See Attribute Targets for more information.
The following sample generates CS0657:
C#
// CS0657.cs
// compile with: /target:library
public class TestAttribute : System.Attribute {}
[return: Test] // CS0657 return not valid on a class
class Class1 {}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: