c# - Dual purposing an application to run as winform or command line utillity -


Sorry my title is also ambiguous, but I do not know what I want to do.

I have a Winform application that was trying double purpose, so it can also be run as a command line utility by our automation system. In the program main () I am performing the conditional execution of the desired code. The only problem is that (even if you are entering the console) a command window is not being launched.

Below is my main (headless execution is being executed correctly):

  [statatread] static zero main () {Application.EnableVisualStyles (); Application.SetCompatibleTextRenderingDefault (wrong); If (legitimate legitimate lines ()! Turn on (New Test ResultForm ()); Else {Headless Execution (); }}    

Remove all logic in a different, class assembly.

Refer this assembly to a Winform and console application.

Comments