Testing command line parameters in a console application with Visual Studio

I’m preparing a more interesting article than this, tidying up the code, removing the hardcoding, so when I’ve doubts about how to add arguments in order to test my application and a new console project always asks me.

Console Application arguments

True story: create a few variables and use them as a request that never comes… because we want to debug as fast as we can. We don’t want to open a console and copy again and again the same command with arguments in order to simulate a real call.
However, I would not like to do this because I don’t want my code has to live with path strings, variables made constant, and so on. The truth is that the solution is quite simple: just select the project with the right button, access the Properties option and add the arguments in the Debug tab, using the Command line arguments section.

Debug Command line arguments

New year’s promise: Less hardcoding even in the demos!

Happy debugging!