.NET Core is cross-platform, and in this short post, I will describe a simple method to detect the underlying operating system on run-time.
There are situations when we want to run a different piece of code based on the operating system. This capability could be useful in various scenarios e.g. I wanted to obtain the underlying hardware information in order to bind it to a licensing mechanism. While its true that .NET Core already supports a wide variety of operations, in this particular use case, there is no support to obtain this information cross-platform.
.NET Core is cross-platform, and in this short post, I will describe a simple method to detect the underlying operating system on run-time.
There are situations when we want to run a different piece of code based on the operating system. This capability could be useful in various scenarios e.g. I wanted to obtain the underlying hardware information in order to bind it to a licensing mechanism. While its true that .NET Core already supports a wide variety of operations, in this particular use case, there is no support to obtain this information cross-platform. […]