-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Obsolete WebRequest, ServicePoint and WebClient #41400
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
Obsolete WebRequest, ServicePoint and WebClient #41400
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
| } | ||
|
|
||
| [Obsolete("Serialization is obsoleted for this type. https://go.microsoft.com/fwlink/?linkid=14202")] | ||
| [Obsolete(Obsoletions.WebRequestMessage, DiagnosticId = Obsoletions.WebRequestDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HttpClient does not support file URIs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an alternative api for fie URIs?
It will warn even I remove this line if the FileWebRequest is created by WebRequest.Create() / CreateDefault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The closest API we have is for a user to call Uri.LocalPath and use File.Open. It should still be obsoleted, but a message of "use HttpClient" doesn't make sense.
dc85370 to
11bb04e
Compare
| <IgnoreForCI Condition="'$(T | ||
| argetOS)' == 'Browser'">true</IgnoreForCI> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is an unnecessery weird line break:
'$(T
argetOS)'
|
/backport to release/5.0 |
|
Started backporting to release/5.0: https://github.com/dotnet/runtime/actions/runs/229111119 |
|
@aik-jahoda Because the type itself isn't obsoleted, the API ref docs don't show it as being obsolete. This doesn't seem like a good user experience for the docs. How much would the extra warnings affect customers if we added the Obsolete attribute to the type as well? |
This PR obsoletes only construction methods to reduce amount of warning and focus to entry point of usage of the obsoleted classes.
One of the PR for #33125