Skip to content

Commit 1efc17a

Browse files
authored
Merge pull request #51520 from dotnet/main
Publish for .NET Framework 3.5 stuff
2 parents 0a54286 + d4fca89 commit 1efc17a

61 files changed

Lines changed: 1011 additions & 121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/core/compatibility/11.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ See [Breaking changes in ASP.NET Core 10](/aspnet/core/breaking-changes/10/overv
2828
| [Environment.TickCount made consistent with Windows timeout behavior](core-libraries/11/environment-tickcount-windows-behavior.md) | Behavioral change |
2929
| [MemoryStream maximum capacity updated and exception behavior changed](core-libraries/11/memorystream-max-capacity.md) | Behavioral change |
3030
| [TAR-reading APIs verify header checksums when reading](core-libraries/11/tar-checksum-validation.md) | Behavioral change |
31+
| [ZipArchive.CreateAsync eagerly loads ZIP archive entries](core-libraries/11/ziparchive-createasync-eager-load.md) | Behavioral change |
3132

3233
## Cryptography
3334

@@ -52,3 +53,9 @@ See [Breaking changes in EF Core 11](/ef/core/what-is-new/ef-core-11.0/breaking-
5253
| Title | Type of change |
5354
|-------------------------------------------------------------------|-------------------|
5455
| [Minimum hardware requirements updated](jit/11/minimum-hardware-requirements.md) | Behavioral change |
56+
57+
## SDK and MSBuild
58+
59+
| Title | Type of change |
60+
|-------------------------------------------------------------------|-------------------|
61+
| [mono launch target not set for .NET Framework apps](sdk/11/mono-launch-target-removed.md) | Behavioral change |
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: "Breaking change: ZipArchive.CreateAsync eagerly loads ZIP archive entries"
3+
description: "Learn about the breaking change in .NET 11 where ZipArchive.CreateAsync eagerly loads all ZIP archive entries to avoid synchronous reads on the stream."
4+
ms.date: 02/03/2026
5+
ai-usage: ai-assisted
6+
---
7+
# ZipArchive.CreateAsync eagerly loads ZIP archive entries
8+
9+
<xref:System.IO.Compression.ZipArchive.CreateAsync%2A?displayProperty=nameWithType> now eagerly loads all ZIP archive entries during the method call. This change ensures that accessing the <xref:System.IO.Compression.ZipArchive.Entries?displayProperty=nameWithType> property doesn't perform synchronous reads on the underlying stream, which aligns with asynchronous programming patterns.
10+
11+
## Version introduced
12+
13+
.NET 11 Preview 1
14+
15+
## Previous behavior
16+
17+
Previously, when you created a `ZipArchive` using `CreateAsync`, accessing the `Entries` property could result in synchronous (blocking) read operations being performed on the underlying stream. This behavior was inconsistent with the asynchronous nature of the `CreateAsync` method and could cause issues with streams that don't support synchronous reads.
18+
19+
```csharp
20+
using System.IO;
21+
using System.IO.Compression;
22+
23+
using var stream = new FileStream("archive.zip", FileMode.Open);
24+
using var archive = await ZipArchive.CreateAsync(stream, ZipArchiveMode.Read);
25+
26+
// This call performs synchronous reads on the stream.
27+
// Might throw if the file entries are malformed
28+
// or if the stream doesn't support synchronous reads.
29+
var entries = archive.Entries;
30+
```
31+
32+
## New behavior
33+
34+
Starting in .NET 11, the central directory of the ZIP archive is read asynchronously as part of the `ZipArchive.CreateAsync` method call. Any exceptions related to malformed entries or issues reading the central directory are now thrown during the `CreateAsync` call. Subsequent access to the `Entries` property doesn't perform any read operations on the underlying stream.
35+
36+
```csharp
37+
using System.IO;
38+
using System.IO.Compression;
39+
40+
using var stream = new FileStream("archive.zip", FileMode.Open);
41+
42+
// This call eagerly loads the ZIP archive entries.
43+
// Any exceptions related to malformed entries are surfaced here.
44+
using var archive = await ZipArchive.CreateAsync(stream, ZipArchiveMode.Read);
45+
46+
// Accessing Entries no longer performs stream read operations.
47+
var entries = archive.Entries;
48+
```
49+
50+
## Type of breaking change
51+
52+
This change is a [behavioral change](../../categories.md#behavioral-change).
53+
54+
## Reason for change
55+
56+
This change was made to improve consistency and reliability when working with asynchronous streams. By eagerly loading entries during the `CreateAsync` call, the API avoids unexpected synchronous read operations later. Avoiding synchronous reads is especially important for streams that might end up blocking until data are available (such as network streams). This aligns with the approved API design and provides a more predictable programming experience.
57+
58+
For more information, see [dotnet/runtime#121938](https://github.com/dotnet/runtime/pull/121938), [dotnet/runtime#121624](https://github.com/dotnet/runtime/issues/121624), and the [API design discussion](https://github.com/dotnet/runtime/issues/1541#issuecomment-2715269236).
59+
60+
## Recommended action
61+
62+
If your code uses `ZipArchive.CreateAsync`, ensure that you handle <xref:System.IO.InvalidDataException> exceptions from the `CreateAsync` method call. This exception could already be thrown in previous .NET versions (for example, when the ZIP central directory can't be found), but now it's also thrown for malformed entries that were previously only discovered when accessing the `Entries` property.
63+
64+
## Affected APIs
65+
66+
- <xref:System.IO.Compression.ZipArchive.CreateAsync(System.IO.Stream,System.IO.Compression.ZipArchiveMode,System.Boolean,System.Text.Encoding,System.Threading.CancellationToken)?displayProperty=fullName>
67+
- <xref:System.IO.Compression.ZipArchive.Entries?displayProperty=fullName>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: "Breaking change: mono launch target not set for .NET Framework apps"
3+
description: "Learn about the breaking change in .NET 11 where the .NET SDK no longer automatically sets mono as the launch target for .NET Framework applications on Linux."
4+
ms.date: 02/03/2026
5+
ai-usage: ai-assisted
6+
---
7+
8+
# mono launch target not set for .NET Framework apps
9+
10+
The .NET SDK no longer automatically sets `mono` as the launch target for .NET Framework applications on Linux when using `dotnet run`.
11+
12+
## Version introduced
13+
14+
.NET 11 Preview 1
15+
16+
## Previous behavior
17+
18+
Previously, when you called `dotnet run` on a .NET Framework application on Linux, the SDK automatically set the `RunCommand` and `RunArguments` properties in the project file to use Mono as the runtime:
19+
20+
```xml
21+
<RunCommand Condition="'$(RunCommand)' == ''">mono</RunCommand>
22+
<RunArguments Condition="'$(RunArguments)' == ''">&quot;$(TargetPath)&quot; $(StartArguments)</RunArguments>
23+
```
24+
25+
This allowed .NET Framework applications to be launched directly using `dotnet run` without additional configuration.
26+
27+
## New behavior
28+
29+
Starting in .NET 11, the SDK no longer automatically configures these properties. Running `dotnet run` on a .NET Framework application on Linux fails unless the `RunCommand` and `RunArguments` properties are explicitly set in the project file.
30+
31+
## Type of breaking change
32+
33+
This change is a [behavioral change](../../categories.md#behavioral-change).
34+
35+
## Reason for change
36+
37+
This change was made because running .NET Framework applications on Linux using Mono is no longer officially supported. Mono ownership has transitioned, and the .NET SDK should not automatically configure launch targets for unsupported scenarios.
38+
39+
For more information, see [dotnet/sdk PR #52091](https://github.com/dotnet/sdk/pull/52091).
40+
41+
## Recommended action
42+
43+
If you need to continue running .NET Framework applications on Linux using Mono, you can manually configure the `RunCommand` and `RunArguments` properties in your project file.
44+
45+
## Affected APIs
46+
47+
None.

docs/core/compatibility/toc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ items:
1818
href: core-libraries/11/memorystream-max-capacity.md
1919
- name: TAR-reading APIs verify header checksums when reading
2020
href: core-libraries/11/tar-checksum-validation.md
21+
- name: ZipArchive.CreateAsync eagerly loads ZIP archive entries
22+
href: core-libraries/11/ziparchive-createasync-eager-load.md
2123
- name: Cryptography
2224
items:
2325
- name: DSA removed from macOS
@@ -30,6 +32,10 @@ items:
3032
items:
3133
- name: Minimum hardware requirements updated
3234
href: jit/11/minimum-hardware-requirements.md
35+
- name: SDK and MSBuild
36+
items:
37+
- name: mono launch target not set for .NET Framework apps
38+
href: sdk/11/mono-launch-target-removed.md
3339
- name: .NET 10
3440
items:
3541
- name: Overview

docs/core/extensions/generic-host.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
title: .NET Generic Host
33
description: Learn about the .NET Generic Host, which is responsible for app startup and lifetime management.
4-
ms.date: 09/11/2024
4+
ms.date: 02/04/2026
5+
ai-usage: ai-assisted
56
---
67

78
# .NET Generic Host
@@ -20,6 +21,16 @@ When a host starts, it calls <xref:Microsoft.Extensions.Hosting.IHostedService.S
2021

2122
The main reason for including all of the app's interdependent resources in one object is lifetime management: control over app startup and graceful shutdown.
2223

24+
## Host builder options
25+
26+
.NET provides two approaches for configuring and building a Generic Host:
27+
28+
- <xref:Microsoft.Extensions.Hosting.IHostApplicationBuilder> (`Host.CreateApplicationBuilder`): Introduced in .NET 6, this approach uses a linear, property-based configuration style. Services, configuration, and logging are configured by directly accessing properties on the builder object (for example, `builder.Services`, `builder.Configuration`). This approach is recommended for new projects and is the default in current .NET templates.
29+
30+
- <xref:Microsoft.Extensions.Hosting.IHostBuilder> (`Host.CreateDefaultBuilder`): This is the traditional callback-based approach where configuration is done through chained extension methods (for example, `ConfigureServices`, `ConfigureAppConfiguration`). While fully supported, this legacy approach works best for maintaining compatibility with existing codebases.
31+
32+
Both approaches provide the same core functionality and default behaviors. Choose `IHostApplicationBuilder` for new projects to align with modern .NET patterns and simpler configuration code. Use `IHostBuilder` when maintaining existing applications or when third-party libraries require the callback-based pattern.
33+
2334
## Set up a host
2435

2536
The host is typically configured, built, and run by code in the `Program` class. The `Main` method:

docs/core/testing/mstest-analyzers/mstest0001.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dev_langs:
2323
| **Category** | Performance |
2424
| **Fix is breaking or non-breaking** | Non-breaking |
2525
| **Enabled by default** | Yes |
26-
| **Default severity** | Warning starting with 4.0.0, Info before |
26+
| **Default severity** | Info (Warning in 4.0) |
2727
| **Introduced in version** | 3.2.0 |
2828
| **Is there a code fix** | No |
2929

docs/core/testing/mstest-analyzers/mstest0023.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ms.author: amauryleve
2020
| **Category** | Usage |
2121
| **Fix is breaking or non-breaking** | Non-breaking |
2222
| **Enabled by default** | Yes |
23-
| **Default severity** | Warning starting with 4.0.0, Info before |
23+
| **Default severity** | Info (Warning in 4.0) |
2424
| **Introduced in version** | 3.4.0 |
2525
| **Is there a code fix** | No |
2626

docs/core/testing/mstest-analyzers/mstest0037.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ ms.author: ygerges
1313
---
1414
# MSTEST0037: Use proper 'Assert' methods
1515

16-
| Property | Value |
17-
|-------------------------------------|------------------------------------------------------------------------|
18-
| **Rule ID** | MSTEST0037 |
19-
| **Title** | Use proper 'Assert' methods |
20-
| **Category** | Usage |
21-
| **Fix is breaking or non-breaking** | Non-breaking |
22-
| **Enabled by default** | Yes |
23-
| **Default severity** | Warning starting with 4.0.0, Info before |
24-
| **Introduced in version** | 3.7.0 |
25-
| **Is there a code fix** | Yes |
16+
| Property | Value |
17+
|-------------------------------------|------------------------------|
18+
| **Rule ID** | MSTEST0037 |
19+
| **Title** | Use proper 'Assert' methods |
20+
| **Category** | Usage |
21+
| **Fix is breaking or non-breaking** | Non-breaking |
22+
| **Enabled by default** | Yes |
23+
| **Default severity** | Info (Warning in 4.0) |
24+
| **Introduced in version** | 3.7.0 |
25+
| **Is there a code fix** | Yes |
2626

2727
## Cause
2828

docs/core/testing/mstest-analyzers/mstest0045.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ms.author: amauryleve
2020
| **Category** | Usage |
2121
| **Fix is breaking or non-breaking** | Non-breaking |
2222
| **Enabled by default** | Yes |
23-
| **Default severity** | Warning starting with 4.0.0, Info before |
23+
| **Default severity** | Info (Warning in 4.0) |
2424
| **Introduced in version** | 3.10.0 |
2525
| **Is there a code fix** | Yes |
2626

docs/core/testing/mstest-analyzers/mstest0062.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ dev_langs:
1919
| Property | Value |
2020
|-------------------------------------|----------------------------------------------------|
2121
| **Rule ID** | MSTEST0062 |
22-
| **Title** | Avoid out and ref parameters in test methods |
22+
| **Title** | Avoid out and ref parameters in test methods |
2323
| **Category** | Usage |
2424
| **Fix is breaking or non-breaking** | Non-breaking |
2525
| **Enabled by default** | Yes |
26-
| **Default severity** | Info |
26+
| **Default severity** | Warning |
2727
| **Introduced in version** | 4.1.0 |
2828
| **Is there a code fix** | Yes |
2929

0 commit comments

Comments
 (0)