.NET Core – Check which OS you’re running in

.NET Core enables you to write cross-platform C# code. Sometimes you’ll want to do things differently depending on the OS you’re running in. You can use RuntimeInformation.IsOSPlatform() to figure out which OS you’re in, like this: Example – Loading a different native library depending on if you’re in Windows or Linux One practical example of … Read more