Dual purposing an application to run as winform or command line utillity
===

Sorry my title is rather vague but I don't know how to concisely label what I want to do.

I have a winform application which were trying to dual-purpose so it can also be run as a command line utility by our automation system. In the programs `Main()` I am conditionally executed the desired code. The only problem is that (despite logging to Console) a command window is not being launched. What do I need to do to make the application launch a command window and direct stdout to that?

Below is my main (HeadlessExecution is correctly being executed):

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (!ValidateCommandLineArgs())
                Application.Run(new TestResultForm());
            else
            {
                HeadlessExecution();
            }
        }