Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0140

The label 'label' is a duplicate

A label with the same name appeared twice. For more information, see goto (C# Reference).

The following sample generates CS0140:

// CS0140.cs
namespace MyNamespace
{
   public class MyClass
   {
      public static void Main()
      {
         label1: int i = 0;
         label1: int j = 0;   // CS0140, comment this line to resolve
         goto label1;
      }
   }
}

Community Additions

ADD
Show:
© 2014 Microsoft