This documentation is archived and is not being maintained.

Compiler Warning (level 2) CS0164 

Error Message

This label has not been referenced

A label was declared but never used.

The following sample generates CS0164:

// CS0164.cs
// compile with: /W:2
public class a
{
   public int i = 0;

   public static void Main()
   {
      int i = 0;   // CS0164
      l1: i++;
      // the following lines resolve this error
      // if(i < 10)
      //    goto l1;
   }
}
Show: