Using UseWindowsService to host asp.net core as a Windows service, is there a reliable way of understanding if the application is indeed running as a Windows service or as a console application? I'm asking because in one case (console) GetCurrentDirectory returns the correct current folder while in the other (Windows service) it always returns the "x:\WINDOWS\system32" folder.