Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing command line parameters

Tags:

c#

What is the best way to test a command line parameter from within the Visual Studio C# Express 2010 IDE? All i see is the "Play" button to start debugging (and running) my program.

like image 251
muncherelli Avatar asked Dec 06 '22 01:12

muncherelli


2 Answers

You could set command line arguments in the properties of the project:

alt text

like image 126
Darin Dimitrov Avatar answered Dec 18 '22 15:12

Darin Dimitrov


Setting the arguement value in the project properties is good if the values don't change.

If you are wanting to test many different command line arguement combinations, going to the Properties window between each run can get very tedious. One way to get around this is to place a breakpoint on the { at the start of the Main method and set a debug watch on the command arguments.

Then all that is needed is to run the program, wait for it to break and then edit the value of the arguement in the watch window. When you continue execution it will be as if you had given those command line arguements.

like image 45
David Culp Avatar answered Dec 18 '22 16:12

David Culp