title: How do I create a C# app that decides itself whether to show as a console or windowed app?
body: <p>Is there a way to launch a C# application with the following features?</p>
  
  <ol>
  <li>It determines by command-line parameters whether it is a windowed or console app</li>
  <li>It doesn't show a console when it is asked to be windowed and doesn't show a GUI window when it is running from the console.</li>
  </ol>
  
  <p>For example, <pre>myapp.exe /help</pre> would output to stdout on the console you used, but <pre>myapp.exe</pre> by itself would launch my Winforms or WPF user interface.
  <br/><br/>The best answers I know of so far involve having two separate exe and use IPC, but that feels really hacky. </p>
  
  <p><br/>What options do I have and trade-offs can I make to get the behavior described in the example above? I'm open to ideas that are Winform-specific or WPF-specific, too.</p>