Visual Studio should be highlighting a particular line when it hits that exception. Let me guess: this one?
int input = int.Parse(userInput[0]);
That's nothing to do with the switch
statement, but to do with the arguments to Main()
. Those get there from the command line, for example when you invoke your program by typing
command some-parameter
at the C:\ command prompt, or from your Command line arguments which you can set in the Debug page when you look at the Properties of your project.