更新:2007 年 11 月
错误消息
无法应用属性类“class”,因为它是抽象的
abstract 自定义属性类不能用作属性。
下面的示例生成 CS0653:
// CS0653.cs
using System;
public abstract class MyAttribute : Attribute
{
}
public class My2Attribute : MyAttribute
{
}
[My] // CS0653
// try the following line instead
// [My2]
class MyClass
{
public static void Main()
{
}
}