My code is in a process that might be a Console application, a desktop application, or an ASP.NET application. I'm trying to find out which kind of application I'm running in.
For .NET framework, I can use HostingEnvironment.IsHosted
to see if I'm running in ASP.NET.
But how do I determine this for a .NET Core application? Note that it can be both in IIS and self hosted.
Many Thanks.