This documentation is archived and is not being maintained.

Compiler Error CS0163 

Error Message

Control cannot fall through from one case label ('label') to another

When a case statement contains one or more statements and is followed by another case statement, one of the following statements must explicitly terminate the case:

  • return

  • goto

  • break

If you want to implement "fall through" behavior, use goto case #. For more information, see switch (C# Reference)

The following sample generates CS0163:

// CS0163.cs
public class MyClass
   public static void Main()
      int i = 0;

      switch (i)   // CS0163
         case 1:
            // uncomment one of the following lines to resolve
            // return;
            // break;
            // goto case 3;

         case 2:

         case 3:
            i = 0;