|
1 | 1 | --- |
2 | | -title: "Breaking change - HTTP3 support in System.Net.Http disabled by default with PublishTrimmed" |
3 | | -description: "Learn about the breaking change in .NET 10 where HTTP3 support is disabled by default when PublishTrimmed or PublishAot is set to true." |
4 | | -ms.date: 1/20/2025 |
| 2 | +title: "Breaking change - HTTP/3 support in System.Net.Http disabled by default with PublishTrimmed" |
| 3 | +description: "Learn about the breaking change in .NET 10 where HTTP/3 support is disabled by default when PublishTrimmed or PublishAot is set to true." |
| 4 | +ms.date: 07/22/2025 |
5 | 5 | ai-usage: ai-assisted |
6 | 6 | ms.custom: https://github.com/dotnet/docs/issues/47443 |
7 | 7 | --- |
8 | 8 |
|
9 | | -# HTTP3 support in System.Net.Http disabled by default with PublishTrimmed |
| 9 | +# HTTP/3 support in System.Net.Http disabled by default with PublishTrimmed |
10 | 10 |
|
11 | | -Setting `PublishTrimmed` or `PublishAot` to `true` in the project disables HTTP3 support in System.Net.Http by default. |
| 11 | +Setting `PublishTrimmed` or `PublishAot` to `true` in the project disables HTTP/3 support in <xref:System.Net.Http> by default. |
12 | 12 |
|
13 | 13 | ## Version introduced |
14 | 14 |
|
15 | 15 | .NET 10 Preview 6 |
16 | 16 |
|
17 | 17 | ## Previous behavior |
18 | 18 |
|
19 | | -Previously, HTTP3 support was allowed, but might not have actually worked by default in environments where the msquic native library is not available. This resulted in HTTP3 not actually working while the app carried all the code related to it. |
| 19 | +Previously, HTTP/3 support was allowed, but might not have actually worked by default in environments where the msquic native library wasn't available. This resulted in HTTP/3 not actually working while the app carried all the code related to it. |
20 | 20 |
|
21 | 21 | ## New behavior |
22 | 22 |
|
23 | | -Starting in .NET 10, HTTP3 is disabled and the code for it is not included when `PublishTrimmed` or `PublishAot` is set to `true`. |
| 23 | +Starting in .NET 10, HTTP/3 is disabled and the code for it isn't included when `PublishTrimmed` or `PublishAot` is set to `true`. |
24 | 24 |
|
25 | 25 | ## Type of breaking change |
26 | 26 |
|
27 | 27 | This change can affect [source compatibility](../../categories.md#source-compatibility). |
28 | 28 |
|
29 | 29 | ## Reason for change |
30 | 30 |
|
31 | | -Since making HTTP3 work requires extra gestures and often doesn't work by default, the runtime no longer carries the code for it in trimmed or AOT-compiled applications to reduce application size and complexity. |
| 31 | +Since making HTTP/3 work requires extra gestures and often doesn't work by default, the runtime no longer carries the code for it in trimmed or AOT-compiled applications. |
32 | 32 |
|
33 | 33 | ## Recommended action |
34 | 34 |
|
35 | | -To enable HTTP3 support in applications that use `PublishTrimmed` or `PublishAot`, set the `<Http3Support>` property to `true` in your project file: |
| 35 | +To enable HTTP/3 support in applications that use `PublishTrimmed` or `PublishAot`, set the `<HTTP/3Support>` property to `true` in your project file: |
36 | 36 |
|
37 | 37 | ```xml |
38 | 38 | <PropertyGroup> |
| 39 | + ... |
39 | 40 | <PublishTrimmed>true</PublishTrimmed> |
40 | | - <Http3Support>true</Http3Support> |
| 41 | + <HTTP/3Support>true</HTTP/3Support> |
41 | 42 | </PropertyGroup> |
42 | 43 | ``` |
43 | 44 |
|
44 | | -Or for AOT scenarios: |
| 45 | +## Affected APIs |
45 | 46 |
|
46 | | -```xml |
47 | | -<PropertyGroup> |
48 | | - <PublishAot>true</PublishAot> |
49 | | - <Http3Support>true</Http3Support> |
50 | | -</PropertyGroup> |
51 | | -``` |
| 47 | +None. |
52 | 48 |
|
53 | | -## Affected APIs |
| 49 | +## See also |
54 | 50 |
|
55 | | -None. |
| 51 | +- [Trimming options](../../../deploying/trimming/trimming-options.md) |
0 commit comments