Skip to content

Replace obsolete APIs used by WPF #3660

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

Closed
ryalanms opened this issue Oct 16, 2020 · 4 comments
Closed

Replace obsolete APIs used by WPF #3660

ryalanms opened this issue Oct 16, 2020 · 4 comments
Assignees
Labels
Bug Product bug (most likely) rank20 Rank: Priority/rank on a scale of (1..100) urgent status: This issue needs immediate attention
Milestone

Comments

@ryalanms
Copy link
Member

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]
@ryalanms ryalanms added the Bug Product bug (most likely) label Oct 16, 2020
@ryalanms ryalanms added rank20 Rank: Priority/rank on a scale of (1..100) urgent status: This issue needs immediate attention labels Oct 16, 2020
@ryalanms
Copy link
Member Author

ryalanms commented Aug 4, 2021

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?

@jeffhandley
Copy link
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

@ryalanms
Copy link
Member Author

ryalanms commented Aug 4, 2021

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

@ryalanms ryalanms added this to the 6.0.0 milestone Aug 12, 2021
@ryalanms ryalanms modified the milestones: 6.0.0, 6.0.0 RC2 Sep 14, 2021
@ryalanms
Copy link
Member Author

This is being tracked by #5178.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Product bug (most likely) rank20 Rank: Priority/rank on a scale of (1..100) urgent status: This issue needs immediate attention
Projects
None yet
Development

No branches or pull requests

3 participants