public static void Main(string[] args) { var example = new MyExampleApp(); if (args.Contains("--console")) { example.ConsoleRun(args); } else { ServiceBase.Run(example); } }
public static void Main(string[] args) { var example = new MyExampleApp(); if (args.Length == 1 && args[0].Equals("--console")) { example.ConsoleRun(); } else { ServiceBase.Run(example); } }