Skip to content

Commit 17bd6db

Browse files
author
Jan Jahoda
committed
Move to .net 6
1 parent a7f3c43 commit 17bd6db

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

docs/core/compatibility/6.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ If you're migrating an app to .NET 6.0, the breaking changes listed here might a
2121

2222
- [Changes to nullable reference type annotations](core-libraries/6.0/nullable-ref-type-annotation-changes.md)
2323

24+
## Networking
25+
26+
- [WebRequest, WebClient, and ServicePoint are deprecated](networking/6.0/webrequest-deprecate.md)
27+
2428
## Windows Forms
2529

2630
- [Selected TableLayoutSettings properties throw InvalidEnumArgumentException](windows-forms/6.0/tablelayoutsettings-apis-throw-invalidenumargumentexception.md)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: "Breaking change: WebRequest, WebClient, and ServicePoint are deprecated"
3+
description: Learn about the breaking change in .NET 6.0 where WebRequest, WebClient, and ServicePoint are deprecated.
4+
ms.date: ??/??/??
5+
---
6+
7+
### WebRequest, WebClient, and ServicePoint are deprecated
8+
9+
<xref:System.Net.WebRequest>, <xref:System.Net.WebClient>, and <xref:System.Net.ServicePoint> classes are deprecated.
10+
11+
#### Version introduced
12+
13+
6.0
14+
15+
#### Change description
16+
17+
<xref:System.Net.WebRequest>, <xref:System.Net.WebClient>, and <xref:System.Net.ServicePoint> classes were added to .NET Core in version 2.0 for backward compatibility. However, they introduced several runtime breaking changes, for example, `WebRequest.GetRequestStream` allocates memory for the whole response, and `WebClient.CancelAsync` doesn't always cancel immediately.
18+
19+
Starting in .NET 5.0, the <xref:System.Net.WebRequest>, <xref:System.Net.WebClient>, and <xref:System.Net.ServicePoint> classes are deprecated. The classes are still available, but they are not recommended for new development. To reduce the number of analyzer warnings, only construction methods are decorated with the <xref:System.ObsoleteAttribute> attribute.
20+
21+
#### Recommended action
22+
23+
Use the <xref:System.Net.Http.HttpClient?displayProperty=fullName> class instead.
24+
25+
#### Affected APIs
26+
27+
- <xref:System.Net.WebRequest>
28+
- <xref:System.Net.HttpWebRequest>
29+
- <xref:System.Net.FtpWebRequest>
30+
- <xref:System.Net.WebClient>
31+
- <xref:System.Net.ServicePoint>
32+
33+
<!--
34+
35+
#### Affected APIs
36+
37+
- `T:System.Net.WebRequest`
38+
- `T:System.Net.HttpWebRequest`
39+
- `T:System.Net.FtpWebRequest`
40+
- `T:System.Net.WebClient`
41+
- `T:System.Net.ServicePoint`
42+
43+
### Category
44+
45+
Networking
46+
47+
-->

0 commit comments

Comments
 (0)