Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0592 

Error Message

Attribute 'attribute' is not valid on this declaration type. It is valid on 'type' declarations only.

An attribute was applied to a declaration for which it was not intended.


The following sample generates CS0592:

// CS0592.cs
using System;

public class MyAttribute : Attribute 

public class A  // CS0592, MyAttribute is not valid for a class
    public static void Main()

Community Additions

© 2014 Microsoft