Skip to content

Commit 3c57dfa

Browse files
authored
Few more updates to What's new (#42199)
1 parent 5523905 commit 3c57dfa

File tree

3 files changed

+71
-24
lines changed

3 files changed

+71
-24
lines changed

docs/core/whats-new/dotnet-9/libraries.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ ReadOnlySpan<byte> bytes = ...;
2020
string encoded = Base64Url.EncodeToString(bytes);
2121
```
2222

23+
## BinaryFormatter
24+
25+
.NET 9 removes <xref:System.Runtime.Serialization.Formatters.Binary.BinaryFormatter> from the .NET runtime. The APIs are still present, but their implementations always throw an exception, regardless of project type. For more information about the removal and your options if you're affected, see [BinaryFormatter migration guide](../../../standard/serialization/binaryformatter-migration-guide/index.md).
26+
2327
## Collections
2428

2529
The collection types in .NET gain the following updates for .NET 9:

docs/core/whats-new/dotnet-9/overview.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: What's new in .NET 9
3-
description: Learn about the new .NET features introduced in .NET 9.
3+
description: Learn about the new .NET features introduced in .NET 9 for the runtime, libraries, and SDK. Also find links to what's new in other areas, such as ASP.NET Core.
44
titleSuffix: ""
5-
ms.date: 07/10/2024
5+
ms.date: 08/15/2024
66
ms.topic: whats-new
77
---
88
# What's new in .NET 9
@@ -17,19 +17,9 @@ New for .NET 9, the engineering team posts .NET 9 preview updates on [GitHub Dis
1717

1818
The .NET 9 runtime includes a new attribute model for feature switches with trimming support. The new attributes make it possible to define [feature switches](https://github.com/dotnet/designs/blob/main/accepted/2020/feature-switch.md) that libraries can use to toggle areas of functionality.
1919

20-
The runtime also includes numerous performance improvements in the following areas:
20+
Garbage collection includes a *dynamic adaptation to application size* feature that's used by default instead of Server GC.
2121

22-
- Loop optimizations
23-
- Inlining improvements
24-
- PGO improvements: Type checks and casts
25-
- Arm64 vectorization in .NET libraries
26-
- Arm64 code generation
27-
- Faster exceptions
28-
- Code layout
29-
- Reduced address exposure
30-
- AVX10v1 support
31-
- Hardware intrinsic code generation
32-
- Constant folding for floating point and SIMD operations
22+
The runtime also includes numerous performance improvements, including loop optimizations, inlining, and Arm64 vectorization and code generation.
3323

3424
For more information, see [What's new in the .NET 9 runtime](runtime.md).
3525

@@ -51,13 +41,7 @@ For more information, see [What's new in the .NET 9 libraries](libraries.md).
5141

5242
## .NET SDK
5343

54-
The .NET 9 SDK includes improvements to unit testing, including better integration with MSBuild that allows you to run tests in parallel.
55-
56-
For tools, a new option for [`dotnet tool install`](../../tools/dotnet-tool-install.md) lets users (instead of tool authors) decide whether a tool is allowed to run on a newer .NET runtime version than the version the tool targets. And NuGet security audits run on both direct and transitive package references, by default.
57-
58-
The terminal logger is now enabled by default and also has improved usability. For example, the total count of failures and warnings is now summarized at the end of a build.
59-
60-
Finally, new MSBuild script analyzers are available.
44+
The .NET 9 SDK introduces *workload sets*, where all of your workloads stay at a single, specific version until explicitly updated. Unit testing has better MSBuild integration that allows you to run tests in parallel. For tools, a new option for [`dotnet tool install`](../../tools/dotnet-tool-install.md) lets users (instead of tool authors) decide whether a tool is allowed to run on a newer .NET runtime version than the version the tool targets. NuGet security audits run on both direct and transitive package references, by default. The terminal logger is now enabled by default and also has improved usability. For example, the total count of failures and warnings is now summarized at the end of a build. New MSBuild script analyzers are available. The SDK can detect and adjust for version mismatches between the .NET SDK and MSBuild.
6145

6246
For more information, see [What's new in the SDK for .NET 9](sdk.md).
6347

docs/core/whats-new/dotnet-9/sdk.md

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: What's new in the SDK for .NET 9
3-
description: Learn about the new .NET SDK features introduced in .NET 9.
3+
description: Learn about the new .NET SDK features introduced in .NET 9, including for unit testing, terminal logger, tool roll-forward, and build script analyzers.
44
titleSuffix: ""
5-
ms.date: 07/10/2024
5+
ms.date: 08/15/2024
66
ms.topic: whats-new
77
---
88
# What's new in the SDK for .NET 9
99

10-
This article describes new features in the .NET SDK for .NET 9. It's been updated for .NET 9 Preview 6.
10+
This article describes new features in the .NET SDK for .NET 9. It's been updated for .NET 9 Preview 7.
1111

1212
## Unit testing
1313

@@ -126,3 +126,62 @@ The following two BuildCheck rules are run:
126126
When a problem is detected, a diagnostic is produced in the build output for the project that contains the issue.
127127

128128
For more information, see the [design documentation](https://github.com/dotnet/msbuild/blob/main/documentation/specs/BuildCheck/BuildCheck.md).
129+
130+
## Analyzer mismatch
131+
132+
Many users install the .NET SDK and Visual Studio at different cadences. While this flexibility is desirable, it can lead to problems for tooling that needs to interop between the two environments. One example of this kind of tooling is Roslyn Analyzers. Analyzer authors have to code for specific versions of Roslyn, but which versions are available and which is used by a given build is sometimes unclear.
133+
134+
This kind of version mismatch between the .NET SDK and MSBuild is referred to as a *torn SDK*. When you're in this state, you might see errors like this:
135+
136+
> CSC : warning CS9057: The analyzer assembly '..\dotnet\sdk\8.0.200\Sdks\Microsoft.NET.Sdk.Razor\source-generators\Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'.
137+
138+
.NET 9 can detect and automatically adjust for this problem scenario. The SDK's MSBuild logic embeds the version of MSBuild it shipped with, and that information can be used to detect when the SDK is running in an environment with a different version. When that happens, the SDK inserts an implicit download of a support package called Microsoft.Net.Sdk.Compilers.Toolset that ensures a consistent analyzer experience.
139+
140+
## Workload sets
141+
142+
*Workload sets* is an SDK feature intended to give users more control over the workloads they install and the cadence of change of those workloads. In previous versions, workloads would periodically be updated as new versions of individual workloads were released onto any configured NuGet feeds. Now, *all* of your workloads will stay at a specific, single version until you make an explicit update gesture.
143+
144+
You can see what mode your SDK installation is in by running `dotnet workload --info`:
145+
146+
```dotnetcli
147+
> dotnet workload --info
148+
Workload version: 9.0.100-manifests.400dd185
149+
Configured to use loose manifests when installing new manifests.
150+
[aspire]
151+
Installation Source: VS 17.10.35027.167, VS 17.11.35111.106
152+
Manifest Version: 8.0.2/8.0.100
153+
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.2\WorkloadManifest.json
154+
Install Type: Msi
155+
```
156+
157+
In this example, the SDK installation is in 'manifest' mode, where updates are installed as they're available. To opt into the new mode, add a `--version` option to a `dotnet workload install` or `dotnet workload update` command. You can also explicitly control your mode of operation using the new `dotnet workload config` command:
158+
159+
```dotnetcli
160+
> dotnet workload config --update-mode workload-set
161+
Successfully updated workload install mode to use workload-set.
162+
```
163+
164+
If you need to change back for any reason, you can run the same command with `manifests` instead of `workload-set`. You can also use `dotnet workload config --update-mode` to check the current mode of operation.
165+
166+
<!-- Add link to ../../tools/dotnet-workload-sets.md -->
167+
168+
## Containers
169+
170+
- [Publishing support for insecure registries](#publishing-support-for-insecure-registries)
171+
- [Environment variable naming](#environment-variable-naming)
172+
173+
### Publishing support for insecure registries
174+
175+
The SDK's built-in container publishing support can publish images to container registries. Until .NET 9, those registries were required to be secured&mdash;for the .NET SDK to work, they needed HTTPS support and valid certificates. Container engines can usually be configured to work with insecure registries as well, that is, registries that don't have TLS configured, or have TLS configured with a certificate that's invalid. This is a valid use case, but our tooling didn't support this mode of communication.
176+
177+
Starting in .NET 9, the SDK can communicate with insecure registries.
178+
179+
Requirements (depending on your environment):
180+
181+
- Configure the Docker CLI to mark a registry as insecure.
182+
- Configure Podman to mark a registry as insecure.
183+
- Use the `DOTNET_CONTAINER_INSECURE_REGISTRIES` environment variable to pass a semicolon-delimited list of registry domains to treat as insecure.
184+
185+
### Environment variable naming
186+
187+
Environment variables that the container publish tooling uses to control some of the finer aspects of registry communication and security now start with the prefix `DOTNET` instead of `SDK`. The `SDK` prefix will continue to be supported in the near term.

0 commit comments

Comments
 (0)