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

Added Include note about class being obsolete #10015

Merged
merged 7 commits into from
Jun 18, 2024

Conversation

lorieide
Copy link
Contributor

Summary

Describe your changes here.

Fixes #Issue_Number (if available)

@lorieide lorieide requested review from a team as code owners June 12, 2024 14:50
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 12, 2024

This comment was marked as outdated.

@gewarren
Copy link
Contributor

@lorieide What's the motivation behind this PR?

@lorieide
Copy link
Contributor Author

@lorieide What's the motivation behind this PR?

@gewarren Sure. I've been assigned this GitHub issue to resolve MicrosoftDocs/azure-docs#111552

@lorieide
Copy link
Contributor Author

lorieide commented Jun 12, 2024

@gewarren Here's what I found:
The .NET WebRequest and HttpWebRequest classes are indeed considered obsolete and are recommended to be replaced with HttpClient. This is in line with modern development practices and the evolution of the .NET framework. Specifically, as per the Microsoft documentation, starting from .NET 5+, it is advised to use HttpClient instead of WebRequest, HttpWebRequest, ServicePoint, and WebClient.
I validated this information is correct as all of these topics have a scattered Important note about this development.
I recommend adding a warning note as an include below to all of the topics in the WebRequest, ServicePoint, WebClient, and HttpWebRequest Class topics.

This comment was marked as outdated.

@gewarren
Copy link
Contributor

@lorieide Ahh, okay. Currently, if a .NET API is marked with the ObsoleteAttribute, for example, WebRequest.Create, then the API reference docs automatically show the CAUTION block with the text from the ObsoleteAttribute. So that's why you see the info on some APIs and not others. There's also a work item to propagate the obsolete warning to all members of a type that's marked obsolete (although I don't think that applies to any of these 4 System.Net types unfortunately).

Related to #6867.

includes/http-web-request-obsolete.md Outdated Show resolved Hide resolved
includes/service-point-obsolete.md Outdated Show resolved Hide resolved
xml/System.Net/HttpWebRequest.xml Show resolved Hide resolved
xml/System.Net/HttpWebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/HttpWebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copy link

Learn Build status updates of commit 409844e:

✅ Validation status: passed

File Status Preview URL Details
includes/web-request-obsolete.md ✅Succeeded View
xml/System.Net/HttpWebRequest.xml ✅Succeeded View
xml/System.Net/ServicePoint.xml ✅Succeeded View
xml/System.Net/WebClient.xml ✅Succeeded View
xml/System.Net/WebRequest.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@MihaZupan
Copy link
Member

FYI ServicePointManager was just marked as obsolete in dotnet/runtime#103456.
And while types like ServicePoint/WebRequest aren't explicitly marked as obsolete, they effectively are since all the ways to obtain their instances (ServicePointManager.FindServicePoint, WebRequest.Create) are obsolete.

Copy link

Learn Build status updates of commit f9a8675:

✅ Validation status: passed

File Status Preview URL Details
includes/web-request-obsolete.md ✅Succeeded View
xml/System.Net/HttpWebRequest.xml ✅Succeeded View
xml/System.Net/ServicePoint.xml ✅Succeeded View
xml/System.Net/WebClient.xml ✅Succeeded View
xml/System.Net/WebRequest.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

xml/System.Net/HttpWebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/HttpWebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebClient.xml Outdated Show resolved Hide resolved
xml/System.Net/WebClient.xml Outdated Show resolved Hide resolved
xml/System.Net/WebClient.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
xml/System.Net/WebRequest.xml Outdated Show resolved Hide resolved
@gewarren gewarren merged commit 523b75c into dotnet:main Jun 18, 2024
3 checks passed
@lorieide lorieide deleted the leide-web-request-obsolete branch June 19, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants