Skip to content

Commit ab68a59

Browse files
authored
Merge pull request #43143 from dotnet/MihaZupan-patch-1
Update ServicePointManager obsoletion docs
2 parents a6ad905 + 797aead commit ab68a59

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/fundamentals/syslib-diagnostics/syslib0014.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ The following APIs are marked as obsolete, starting in .NET 6. Using them in cod
1414
- <xref:System.Net.WebRequest.CreateHttp%2A?displayProperty=fullName>
1515
- <xref:System.Net.WebRequest.CreateDefault(System.Uri)?displayProperty=fullName>
1616
- <xref:System.Net.HttpWebRequest.%23ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)>
17-
- <xref:System.Net.ServicePointManager.FindServicePoint%2A?displayProperty=fullName>
17+
- <xref:System.Net.ServicePointManager>
1818
- <xref:System.Net.WebClient.%23ctor>
1919

20+
To reduce the number of analyzer warnings, the <xref:System.Net.ServicePoint> class is not marked as obsolete, but all ways of obtaining its instances are.
21+
22+
Settings on <xref:System.Net.ServicePointManager> and <xref:System.Net.ServicePoint> no longer affect <xref:System.Net.Security.SslStream> or <xref:System.Net.Http.HttpClient>.
23+
2024
## Workarounds
2125

2226
Use <xref:System.Net.Http.HttpClient> instead.
2327

28+
See the [HttpWebRequest to HttpClient migration guide](https://learn.microsoft.com/dotnet/fundamentals/networking/http/httpclient-migrate-from-httpwebrequest) for more info.
29+
2430
## Suppress a warning
2531

2632
If you must use the obsolete APIs, you can suppress the warning in code or in your project file.

0 commit comments

Comments
 (0)