.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. Here’s an example of using this to see if you’re running in Windows: Example – Loading a different native library depending … Read more