-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
dotnet/dotnet-api-docs
#4731Labels
area-System.Net.HttpdocumentationDocumentation bug or enhancement, does not impact product or test codeDocumentation bug or enhancement, does not impact product or test code
Milestone
Description
ObsoleteAttribute
will be getting an update to support diagnostic IDs and URLs to help IDEs better manage obsolete API usage.
We should consider annotating WebRequest
and WebClient
with this. I frequently see asks for help with HTTP in .NET, and it's not uncommon to find them using one of these APIs without knowing we prefer them use HttpClient
instead.
Something like
[Obsolete(DiagnosticId="BCL1234", UrlFormat="https://aka.ms/obsoletedotnethttp")]
public class WebRequest // Also: HttpWebRequest, FtpWebRequest, FileWebRequest (aka *WebRequest)
{
}
[Obsolete(DiagnosticId="BCL1234", UrlFormat="https://aka.ms/obsoletedotnethttp")]
public class WebClient
{
}
I would not want to create excessive warnings for users porting Framework apps to .NET 5, so this is predicated on IDE/compiler being updated to allow ignoring specific diagnostic IDs application-wide.
- Obsolete WebRequest, ServicePoint and WebClient #41400 - Runtime obsoletion
- Deprecate service point for server certificate dotnet-api-docs#4731
- WebRequest deprecation docs#20310
- Redirect https://aka.ms/dotnet-warnings/SYSLIB0014 link to:
https://docs.microsoft.com/en-us/dotnet/core/compatibility/fx-core#webrequest-is-not-recomended-for-new-development(a dedicated SYSLIB documentation page was created instead)
geoffkizer
Metadata
Metadata
Assignees
Labels
area-System.Net.HttpdocumentationDocumentation bug or enhancement, does not impact product or test codeDocumentation bug or enhancement, does not impact product or test code