Skip to content

Investigate if OperatingSystem.IsBrowser polyfill that we use for netstandard2.0 is correct #7179

@Youssef1313

Description

@Youssef1313

We get IsBrowser via Polyfill and is implemented as:

        /// <summary>
        /// Indicates whether the current application is running as WASM in a browser.
        /// </summary>
        //Link: https://learn.microsoft.com/en-us/dotnet/api/system.operatingsystem.isbrowser?view=net-10.0
        public static bool IsBrowser() =>
            RuntimeInformation.FrameworkDescription.Contains(".NET WebAssembly");

That implementation doesn't sound correct, looking at https://github.com/dotnet/runtime/blob/7a2016c11cfff514e5df4e56931785b2eb0cb832/src/libraries/System.Private.CoreLib/gen/ProductVersionInfoGenerator.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions