Skip to content

Mark PlatformID.MacOSX obsolete? #18635

@justinvp

Description

@justinvp

Environment.OSVersion.Platform returns PlatformID.Unix on macOS instead of PlatformID.MacOSX, which is consistent with Mono's behavior.

This is already confusing for Xamarin.Mac developers and I think it's going to be confusing for .NET Core developers as well.

(I wish we hadn't added PlatformID.MacOSX for Silverlight, and just used PlatformID.Unix like Mono.)

To help mitigate the confusion, should PlatformID.MacOSX be marked as obsolete, pointing developers to use PlatformID.Unix or RuntimeInformation.IsOSPlatform(OSPlatform.OSX) instead?

And/or hidden from intellisense?

cc: @terrajobst, @KrzysztofCwalina, @weshaggard, @stephentoub

For reference:

    public enum PlatformID
    {
        Win32S = 0,
        Win32Windows = 1,
        Win32NT = 2,
        WinCE = 3,
        Unix = 4,
        Xbox = 5,
        MacOSX = 6
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-needs-workAPI needs work before it is approved, it is NOT ready for implementationarea-System.Runtimedesign-discussionOngoing discussion about design without consensus

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions