共用方式為


編譯器警告 (層級 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 {}