Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
No such label 'label' within the scope of the goto statement
The label referenced by the goto statement could not be found within the scope of the goto
statement.
The following sample generates CS0159:
// CS0159.cs
public class Class1
{
public static void Main()
{
int i = 0;
switch (i)
{
case 1:
goto case 3; // CS0159, case 3 label does not exist
case 2:
break;
}
goto NOWHERE; // CS0159, NOWHERE label does not exist
}
}
.NET feedback
.NET is an open source project. Select a link to provide feedback: