This topic has not yet been rated - Rate this topic

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:

// CS0657.cs
// compile with: /target:library
public class TestAttribute : System.Attribute {}
[return: Test]   // CS0657 return not valid on a class
class Class1 {}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ