In .NET Standard 2.0, do I have any ways of determining the operating system and architecture on which my library is running ?
I need to know the OS and architecture to determine which version of nodejs to extract and run at run-time.
Edit about comments : I already found the two methods that you offer but, according to the documentation OperatingSystem.Version and Environment.OSVersion supports the following .net version (standard 2.0 isn't included it seems)

edit 2 - not a duplicate : As per my first edit above, my question targets .NET Standard 2.0, not .NET Framework or .NET Core. .NET Standard 2.0 is crossplateform byt this page only lists windows version which is a very good way to know that this cannot match my needs.
RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With