C# Error CS0076 – The enumerator name ‘value__’ is reserved and cannot be used

C# Compiler Error

CS0076 – The enumerator name ‘value__’ is reserved and cannot be used

Reason for the Error

You will receive this error when you are using value__ as an identifier with-in the enum in C#.

For example, try compiling the below code.

enum EmploymentType { value__ =1 }
public class DeveloperPublish
{
    public static void Main()
    {

    }
}

You will receive the below error as value__ is a reserved word and cannot be used as identifier in enumeration in C#.

Error CS0076 The enumerator name ‘value__’ is reserved and cannot be used.

C# Error CS0076 – The enumerator name 'value__' is reserved and cannot be used

Solution

To fix the error CS0076 in C#, ensure that the enumerator doesn’t have an identifier value__ and use a different identifier name.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...