title: How to debug a C# command-line program
body: <p>I'm trying to build a command-line tool in C# with VS2010.</p>
  
  <p>My question is: how do I debug this, like I would a winforms.<br>
  With winforms, I can step through the code, see the values at each individual step, etc...</p>
  
  <p>Here however, the program only responds when I talk to it from the command line. I can't start a debug session, since that will first fully start the program. And due to the nature of the program, it will shut itself because there were no command-line arguments.</p>
  
  <p>So no debugging can occur.</p>
  
  <p>What do I need to do here?</p>
  
  <p>EDIT: an example, since someone made a comment that makes me feel this explanation is needed.</p>
  
  <p>C:\Path\To\File\file.exe -help</p>
  
  <p>That is an example of how this program is adressed. The command, -help, is given in the same line that the program is started. In other words, I cannot first start the program, and then give it a command while it's running... because it won't be running anymore. It'll start, see that it had no arguments on startup, and because of that, shut down. That's how a command-line tool works.</p>
  
  <ol>
  <li>Activate</li>
  <li>Process possible arguments</li>
  <li>Output results</li>
  <li>Shut down automatically</li>
  </ol>
  
  <p>It is not something that keeps running till you click the little x in the top right corner.</p>