Skip to content

Add back ObsoletedInOSPlatformAttribute for net6 #47601

@spouliot

Description

@spouliot

Background and Motivation

Proposed API

Original specs

This was removed in 5.0 RC

dotnet/docs#20635 mention

ObsoletedInOSPlatformAttribute was removed, as this annotation is not needed at this time

With the addition of Xamarin SDK I think the need/time has come :-)

Usage Examples

Apple commonly obsoletes API and provide better alternatives for them. The headers (both C and Objective-C) includes macros that help developers (and the Xcode IDE) select the best API for the OS version being targeted.

The existing Xamarin SDKs (iOS/Mac) annotate the API with the similar attributes. This allow developers to identify which API are obsolete, well before they become deprecated (which generally means they will be rejected if submitted to one of the Apple App Stores).

Current Dotnet (planned)
[Introduced (PlatformName.iOS, 7,0)] [SupportedOSPlatform ("ios7.0")]
[Obsoleted (PlatformName.iOS, 12,1)] [ObsoletedInOSPlatform ("ios12.1")]
[Deprecated (PlatformName.iOS, 14,3)] [UnsupportedOSPlatform ("ios14.3")]
[Unavailable (PlatformName.iOS)] [UnsupportedOSPlatform ("ios")]

The removal of ObsoletedInOSPlatform is blocking the completion of dotnet/macios#10170

Alternative Designs

None

Risks

The lack of this attribute means the analyzer can't have feature parity (regression) compared to the existing features available on VS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions