System.Environment.OSVersion doesn't seem to be a part of .net core 5.0 (dnxcore50).
I am trying to determine which OS a user is on so when they save a file to the filesystem I know rather to use '/' or '\'
What should I use instead?
Don't do the detection yourself. Use System.IO.Path.DirectorySeparatorChar. Also, if you always use Path to manipulate paths then you should get formatting that you need. This also works with URLs.
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