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,
You can use Visual Studio to attach a debugger to the command line application, once it is under way with the correct arguments. I'm not sure if your application will terminate quickly or give you any opportunity to attach the debugger, but if it will, this should work.
I'm using VS2008 but I'll bet the process is similar in 2010:
Tools
and click Attach to Process
Attach
Now VS should be able to finagle its way into your application and break on an error.