HomeCSharpC# 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

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

This C# program calculates and displays an upper triangular matrix based on user input. Problem Statement: The program takes the...
This C# program serves as a demonstration of bitwise operators, which are fundamental operators used for manipulating individual bits in...
This C# program is designed to interchange or swap the columns of a matrix. A matrix is a two-dimensional array...