Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate unsupported APIs in .Net core as Obsolete - Reflection area #50941

Merged
merged 11 commits into from
Apr 25, 2021

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Apr 8, 2021

Fixes #50529

As part of #47228 we are annotating APIs not supported in .Net Core with [Obsolete] attribute

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, assuming that this has gone through API review and that the breaking change has been approved.

@buyaa-n
Copy link
Contributor Author

buyaa-n commented Apr 8, 2021

assuming that this has gone through API review and that the breaking change has been approved.

There was no API review, but we had an offline discussion that we want to Obsolete APIs not supported in .Net core for all platforms so that developers get warnings at design time instead of getting PNSE at runtime (from that perspective i think it is not breaking change). We filed issues for each area so that area owners handled it appropriately, main thing the area owners need to consider/make sure is the APIs are really not supported on any platform and not intended/planned to get supported in the future. For the APIs in this PR APIs in Assembly and Type are documented that it is not supported on .NetCore, APIs in StrongNameKeyPair not documented but doesn't look like supported on .Net Core, all of them has no associated issue for future support

@GrabYourPitchforks
Copy link
Member

According to source.dot.net, there are only two instantiations of StrongNameKeyPair throughout the entirety of the indexed code bases, and both of them would have thrown PNSE anyway. So for these callers, changing the StrongNameKeyPair ctor is not a breaking change.

https://github.com/dotnet/msbuild/blob/9bcc06cbe19ae2482ab18eab90a82fd079b26897/src/Tasks/StrongNameUtils.cs#L68-L84
https://github.com/dotnet/msbuild/blob/9bcc06cbe19ae2482ab18eab90a82fd079b26897/src/Tasks/StrongNameUtils.cs#L99-L115

Copy link
Member

@GrabYourPitchforks GrabYourPitchforks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A missing UrlFormat, but otherwise LGTM. Thanks!

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there's a check failing in src/mono/System.Private.CoreLib/src/System/RuntimeTypeHandle.cs where another pragma will be needed. But I preemptively approve based on that getting resolved.

@RussKie
Copy link
Member

RussKie commented Apr 27, 2021

What course of action should the downstream consumers affected by this change take? E.g. dotnet/winforms is currently broken because StrongNameKeyPair is a part of our public API.

  • Do we remove the public API?
  • Do we mark it as obsolete? If so, what obsoletion message should we put, as the runtime obsoletion strings aren't available to us.

/cc: @terrajobst

@terrajobst
Copy link
Member

You could also just suppress the obsoletion. I doubt anyone would care :-)

@RussKie
Copy link
Member

RussKie commented Apr 27, 2021

I didn't consider it, that's an option too :)
Thanks!

RussKie added a commit to dotnet/winforms that referenced this pull request Apr 27, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
@buyaa-n buyaa-n added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label May 31, 2022
@ghost ghost added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label May 31, 2022
@buyaa-n buyaa-n removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label May 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Reflection breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. new-api-needs-documentation
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Annotate unsupported APIs in System.Reflection
9 participants