I am writing a Console application that pass a string array of arguments to the Main. Using the F5 to debug would throw me an exception because I have not pass the arguments.
The way I debug/test the code where I can pass arguments is to build the solution and then run the .exe on the command prompt, but it’s very inconvenient.
Is there a way to pass arguments to debug?
From within Visual Studio? Absolutely – go to the project’s property designer, select the Debug page and you can set the command line arguments, as well as the working directory. See MSDN for more information.