Closed Junjun-zhao closed 3 weeks ago
@marcpopMSFT Could you please take look at this issue and triage this issue? Meanwhile, could you help confirm if this is a RC2 blocker. Thanks.
@Junjun-zhao this is not an SDK issue nor is it likely a blocker since it's just a warning. @jaredpar @arkalyanms may know where to route this.
ServicePointManager was obsoleted in issue https://github.com/dotnet/runtime/issues/71836, PR https://github.com/dotnet/runtime/pull/103456 before v9.0.0-preview.6.24327.7; that still has the "new-api-needs-documentation" label. I suppose this should be added to the net9.0 breaking changes list and to the SYSLIB0014 documentation, and then the label should be removed.
Thanks @KalleOlaviNiemitalo. I didn't find the breaking change doc about this issue. Could you please share the doc once it is filed?
FYI. This is the template for create a breaking change issue :https://github.com/dotnet/docs/issues/new?assignees=gewarren&labels=breaking-change%2CPri1%2Cdoc-idea&projects=&template=02-breaking-change.yml&title=%5BBreaking+change%5D%3A+
@KalleOlaviNiemitalo Any update for the document for this issue?
These types were already effectively obsolete since .NET 6. The change in .NET 9 moves the obsoletion to the whole type to make that more obvious for the couple of remaining static members that wouldn't have triggered warnings before.
I've tweaked the docs a bit (https://github.com/dotnet/docs/pull/43143) and filed a breaking change issue (https://github.com/dotnet/docs/issues/43144) to communicate that better.
Thank you @MihaZupan. Closing this issue as "Update ServicePointManager obsoletion docs" PR and breaking change issue have been filed.
Application Name: DiscordChatExporter OS: Windows 10 21H2 CPU: X64 .NET Build Number: dotnet-sdk-9.0.100-rc.2.24470.13 App & Source Checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2260224 Github Link: https://github.com/Tyrrrz/DiscordChatExporter
Verify Scenarios: 1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.300(default target net8.0): Pass 2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.6.24317.13(retarget net9.0): Pass 3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.6.24324.9(retarget net9.0): Fail 4). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-rc.2.24470.13(retarget net9.0): Fail
Description : When retarget the 3rd party application to net9.0 and build with the latest .NET 9 sdk, it failed with "warning as error":
'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014)
Findings: We retarget the app to net9.0 and build with dotnet-sdk-9.0.100-preview.6.24324.9 and earlier versions, there is no warning. We found this warning is caused by
ServicePointManager.DefaultConnectionLimit
, butServicePointManager.DefaultConnectionLimit
is not defined as observer in this document. SYSLIB0014 warning - .NET | Microsoft LearnMinimal Repro steps (Demo attached: ConsoleDemo.zip):
.NET SDK: Version: 9.0.100-rc.2.24470.13 Commit: 3229e54b07 Workload version: 9.0.100-manifests.8fbc914b MSBuild version: 17.12.0-preview-24469-05+fea15fbd1
Runtime Environment: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\9.0.100-rc.2.24470.13\
Host: Version: 9.0.0-rc.2.24463.7 Architecture: x64 Commit: static
.NET SDKs installed: 9.0.100-rc.2.24470.13 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 9.0.0-rc.2.24466.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 9.0.0-rc.2.24463.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 9.0.0-rc.2.24464.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]