private static void CheckWindowsArguments(string[] args) { if (SystemHelpers.IsWindows()) { _isConsole = args.Any(x => x.ToLower() == "--console"); if (_isConsole) { // make a kernel32.dll call to detach application from console // this will allow it to run in the background, even after closing // instance of console it was called from _hasConsole = AllocConsole(); } } }