Skip to content

Obsolete old HTTP APIs #33125

Closed
dotnet/dotnet-api-docs
#4731

Description

@scalablecory

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.

Activity

  1. added this to the 5.0 milestone on Mar 3, 2020
  2. added
    untriaged
    on Mar 3, 2020
  3. removed
    untriaged
    on Mar 3, 2020
  4. added
    enhancement
    documentation
    and removed
    enhancement
    on May 29, 2020
  5. karelz commented on Aug 20, 2020

    @karelz
    Member

    @scalablecory can you please provide guidance / options here? (the latest status of this feature)

  6. jeffhandley commented on Aug 28, 2020

    @jeffhandley
    Member

    I left some feedback on #41526 that likely applies to all of the obsoletions here. I'll take a look at the other PRs though.

  7. modified the milestones: 5.0.0, 6.0.0 on Aug 31, 2020
  8. karelz commented on Aug 31, 2020

    @karelz
    Member

    Fixed in 6.0 in PR #41400

    Note: Porting to 5.0 was rejected this late in the game -- see #41526

  9. aik-jahoda commented on Aug 31, 2020

    @aik-jahoda
    Contributor

    Reopening to help track the documentation.

  10. jeffhandley commented on Oct 21, 2020

    @jeffhandley
    Member

    When this is worked on to track the documentation, please also see #41759, where I provided some other feedback.

  11. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2020
  12. gewarren commented on Apr 26, 2021

    @gewarren
    Contributor

    Should this have been closed by dotnet/dotnet-api-docs#4731? The literal comment is partially fixes #33125. The dotnet/docs PR is still in draft, and the aka.ms link wasn't updated. However, with dotnet/docs#23915, perhaps it should be redirected to the new SYSLIB0014 article instead.

  13. jeffhandley commented on Apr 26, 2021

    @jeffhandley
    Member

    Probably not -- that might have been a false positive auto-close because of fixes #33125.

    I do think this will get wrapped up with dotnet/docs#23915 though, and when the SYSLIB0014 page is published, we will need to update the aka.ms link. I'll reopen this to make sure it gets tracked.

  14. jeffhandley commented on Jul 31, 2021

    @jeffhandley
    Member

    The documentation page is in place and the aka.ms link is configured to point to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Net.Httpdocumentation

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions