Compilerfehler CS0653

Die Attributklasse "Klasse" kann nicht angewendet werden, weil sie abstrakt ist

Eine abstrakte benutzerdefinierte Attributklasse kann nicht als Attribut verwendet werden.

Im folgenden Beispiel wird CS0653 generiert:

// 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()  
   {  
   }  
}