Cannot have a null string case label
A switch statement cannot test for a null string.
The following sample generates CS0223:
public class MyClass { public static void Main() { string s = "test"; switch (s) { case null: // CS0223 // try the following line instead // case "test": System.Console.WriteLine("in a case"); return; default: System.Console.WriteLine("in default"); } } }