编译器警告(等级 1)CS0657
更新:2007 年 11 月
错误消息
“attribute modifier”对于此声明不是有效的属性位置。此声明的有效属性位置是“locations”。该块中的所有属性都将被忽略。
编译器在无效的位置找到了属性修饰符。有关更多信息,请参见属性目标。
下面的示例生成 CS0657:
// CS0657.cs
// compile with: /target:library
public class TestAttribute : System.Attribute {}
[return: Test] // CS0657 return not valid on a class
class Class1 {}