Closed Budsy closed 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
System.Net.WebClient was deprecated and removed, instead you need to use System.Net.HttpClient.
System.Net.WebClient was deprecated and removed
It was obsoleted in .NET 5, but it wasn't removed. It's still there and not marked as obsolete in .NET Core 3.1.
To Reproduce
I did this and it compiles fine for me. Can you share your repro project that fails to compile?
This issue has been automatically marked as no recent activity because it has been marked as needing more info but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 more days.
This issue has been automatically marked no recent activity
because it has been marked as needs author feedback
but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 more days. Any new comment (by anyone, not necessarily the author) will remove no recent activity
The bug: (.NET Core 3.1 winforms VS project)
System.Net.WebClient.UploadString(string url, string method, string payload) nor the Uri,string,string overload will not compile. Intellisense shows the overload option as documented for Core 3.1, but shows warning and won't compile.
To Reproduce
Simply open a VisualStudio2019 project for .NET Core 3.1 winforms and try to construct:
System.Net.WebClient client = new System.Net.WebClient(); var response = client.UploadString(url,"POST","{'hello':'goodbye'}");
Exceptions not reproduceable because this code will prevent compilation.
ASP.NET Core version:
.NET Core SDK (reflecting any global.json): Version: 3.1.302 Commit: 41faccf259
Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.302\
Visual Studio info:
Microsoft Visual Studio Community 2019 Version 16.6.5 VisualStudio.16.Release/16.6.5+30320.27 Microsoft .NET Framework Version 4.8.03752
Installed Version: Community