Skip to content

[QUIC] Improve MSQuic OS Version detection #32575

Closed

Description

@Tratcher

OperatingSystem ver = Environment.OSVersion;
if (ver.Platform == PlatformID.Win32NT && ver.Version < new Version(10, 0, 19041, 0))

Environment.OSVersion is an unreliable API that reports old versions for compat purposes. It only reports the correct Win10 version if an app manifest is added. VS and the test runner have this manifest but sample apps and customer apps won't.
https://stackoverflow.com/questions/33328739/system-environment-osversion-returns-wrong-version

We're going to need a different way to check for this support. Worst case we look at the registry.

Activity

  1. am11 commented on Feb 20, 2020

    @am11
    Member

    fwiw, dotnet-cli uses this property for dotnet --info, which I think does not rely on the app manifest:

    public static string OperatingSystemVersion { get; } = PlatformApis.GetOSVersion();

  2. added this to the 5.0 milestone on Feb 20, 2020
  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Feb 20, 2020
  4. jkotas commented on Feb 20, 2020

    @jkotas
    Member

    Microsoft.DotNet.PlatformAbstractions package is obsolete.

    P/Invoking Ntdll.RtlGetVersionEx is your best bet.

  5. jkotas commented on Feb 20, 2020

    @jkotas
    Member

    It only reports the correct Win10 version if an app manifest is added. VS and the test runner have this manifest but sample apps and customer apps won't.

    This is considered to be a feature. It is not necessary something you want to "fix".

  6. am11 commented on Feb 20, 2020

    @am11
    Member

    Microsoft.DotNet.PlatformAbstractions package is obsolete.

    will its sources be removed and dotnet-cli switch to p/invoke?

    Edit: nvm, found the issue tracking it - #3470

  7. Tratcher commented on Feb 20, 2020

    @Tratcher
    MemberAuthor

    This is considered to be a feature. It is not necessary something you want to "fix".

    This version check is to see if the OS has the right TLS 1.3 support. Http3 will have other opt-in guards to maintain compat. Once a developer opts in, false negatives from this version check are an unnecessary hurdle and support burden.

  8. changed the title [-]Improve MSQuic OS Version detection[/-] [+][QUIC] Improve MSQuic OS Version detection[/+] on Mar 11, 2020
  9. Tratcher commented on May 12, 2020

    @Tratcher
    MemberAuthor

    #33643 fixed Environment.OSVersion so we can depend on that again.

  10. eerhardt commented on May 12, 2020

    @eerhardt
    Member

    @Tratcher - do you want me to update #36302 to add back the Environment.OSVersion check?

  11. Tratcher commented on May 12, 2020

    @Tratcher
    MemberAuthor

    @jkotalik have you confirmed which version we need?

  12. jkotalik commented on May 12, 2020

    @jkotalik
    Contributor

    No, let's just merge what we have in that #36302 for now. I'll need to figure out if the Windows slow preview train has schannel support, which will take a while.

  13. modified the milestones: 5.0.0, 6.0.0 on Aug 11, 2020
  14. scalablecory commented on Sep 23, 2020

    @scalablecory
    Contributor

    I'm thinking it's better to implement this in MsQuic -- microsoft/msquic#92

  15. ManickaP commented on Apr 15, 2021

    @ManickaP
    Member

    This can be covered by analyzers with SupportedOSPlatform, first crude draft is already in #49261, we just need a complete list of supported OS/versions/distros.

    edit:
    This will not help with checking the minimal Windows version. However, that should be a one-liner in S.N.Quic initialization: https://docs.microsoft.com/en-us/dotnet/api/system.operatingsystem.iswindowsversionatleast?view=net-5.0.

  16. self-assigned this
    on Jun 21, 2021
  17. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 21, 2021
  18. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 24, 2021
  19. ghost locked as resolved and limited conversation to collaborators on Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions