You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine on normal installs of Ubuntu, but in Ubuntu 18.04 on WSL2, the call to RuntimeInformation.OSDescription returns the following:
"Linux 4.19.43-microsoft-standard dotnet/corefx#1 SMP Mon May 20 19:35:22 UTC 2019"
Is there a way to get the distribution name/version from .NET Core in this scenario? Or should we resort to something like piping the output of lsb_release -a?
The text was updated successfully, but these errors were encountered:
Looks like you need to add a package reference to Microsoft.DotNet.PlatformAbstractions then you can get it from Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystem and Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemVersion
We would like to expose this information in the bass class libraries but that work has been pushed out of 3.0 for now. That is tracked already in https://github.com/dotnet/corefx/issues/31002
If you don't want the package reference (which is great, we would rather deprecate that package long term) looks like you can copy code. See LoadDistroInfo in that repo.
Perfect. Thanks Dan. I'll talk it over with the team and make a call on which way to go. Good to know you'd like to deprecate, as that'll probably impact our decision.
Over at https://github.com/aspnet/HttpRepl, there's some code that does detection of linux distro in order to decide if some STTY settings need to be changed.
This works fine on normal installs of Ubuntu, but in Ubuntu 18.04 on WSL2, the call to
RuntimeInformation.OSDescription
returns the following:Is there a way to get the distribution name/version from .NET Core in this scenario? Or should we resort to something like piping the output of
lsb_release -a
?The text was updated successfully, but these errors were encountered: