Skip to content

Replace obsolete APIs used by WPF #3660

Closed

Description

@ryalanms

WPF is using obsolete APIs. These need to be replaced for 6.0.

WebRequest.WebRequest()
WebRequest.Create(Uri)
Uri.EscapeUriString(string)

D:\wpf7\src\Microsoft.DotNet.Wpf\src\PresentationCore\ref\PresentationCore.cs(11,9): error SYSLIB0014: 'WebRequest.WebR
equest()' is obsolete: 'Use HttpClient instead.' [D:\wpf7\src\Microsoft.DotNet.Wpf\src\PresentationCore\ref\Presentatio
nCore-ref.csproj]

D:\wpf7\src\Microsoft.DotNet.Wpf\src\PresentationCore\MS\Internal\WpfWebRequestHelper.cs(76,30): error SYSLIB0014: 'Web
Request.Create(Uri)' is obsolete: 'Use HttpClient instead.' [D:\wpf7\src\Microsoft.DotNet.Wpf\src\PresentationCore\Pres
entationCore.csproj]

D:\wpf7\src\Microsoft.DotNet.Wpf\src\ReachFramework\PrintConfig\FallbackPTProvider.cs(403,29): error SYSLIB0013: 'Uri.E
scapeUriString(string)' is obsolete: 'Uri.EscapeUriString can corrupt the Uri string in some cases. Consider using Uri.
EscapeDataString for query string components instead.' [D:\wpf7\src\Microsoft.DotNet.Wpf\src\ReachFramework\ReachFramew
ork.csproj]

Activity

  1. added
    Bug
    rank20
    urgent
    on Oct 16, 2020
  2. ryalanms commented on Aug 4, 2021

    @ryalanms
    MemberAuthor

    https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/obsolete-apis-with-custom-diagnostics

    @jeffhandley: WPF has some uses of WebRequest and HttpWebRequest that will be very difficult to remove. Is it possible for WPF to continue using them or will they stop working for .NET 6.0?

  3. jeffhandley commented on Aug 4, 2021

    @jeffhandley
    Member

    Those APIs will continue to function in .NET 6; you can suppress the warnings if you need to continue using them.

    https://docs.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib0014#workarounds

  4. ryalanms commented on Aug 4, 2021

    @ryalanms
    MemberAuthor

    @singhashish-wpf: Let's defer the WebRequest and HttpWebRequest replacements to .NET 7.0. Please leave the existing suppression for SYSLIB0014 in place.

  5. added this to the 6.0.0 milestone on Aug 12, 2021
  6. modified the milestones: 6.0.0, 6.0.0 RC2 on Sep 14, 2021
  7. ryalanms commented on Sep 14, 2021

    @ryalanms
    MemberAuthor

    This is being tracked by #5178.

  8. ghost locked as resolved and limited conversation to collaborators on Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Bugrank20urgent

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions