I\'m trying to build a command-line tool in C# with VS2010.
My question is: how do I debug this, like I would a winforms.
With winforms, I can step through the code,
Either add a breakpoint to the opening { of Main, or step into the program (Debug menu). At that point set a watch on the parameter for main (the command line arguments) by selecting it and either right-click/Add Watch or drag the parameter to to watch window if it is already open. Double-click the Value column in the Watch window and set it to whatever you want it to be.
Note: the value added must be valid code -- that is, to add a -help to the string[] you would have to type new string[] {"-help"} or new [] {"-help"} depending on the version you are using.
This has the advantage over setting the parameter in the Debug tab of the Properties window by allowing different parameters for each run without having to return to the Properties window.