Skip to content

Commit 8059bfd

Browse files
authored
Split up what's new in .NET 8 by SDK/runtime (#39417)
1 parent 1d9a109 commit 8059bfd

File tree

15 files changed

+2309
-2262
lines changed

15 files changed

+2309
-2262
lines changed

.openpublishing.redirection.core.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,11 @@
12171217
"source_path_from_root": "/docs/core/versions/version-history.md",
12181218
"redirect_url": "/dotnet/core/versions/selection"
12191219
},
1220+
{
1221+
"source_path_from_root": "/docs/core/whats-new/dotnet-8.md",
1222+
"redirect_url": "/dotnet/core/whats-new/dotnet-8/overview",
1223+
"redirect_document_id": true
1224+
},
12201225
{
12211226
"source_path_from_root": "/docs/core/whats-new/index.md",
12221227
"redirect_url": "/dotnet/core/whats-new/dotnet-7",

docs/core/compatibility/8.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff
162162

163163
## See also
164164

165-
- [What's new in .NET 8](../whats-new/dotnet-8.md)
165+
- [What's new in .NET 8](../whats-new/dotnet-8/overview.md)

docs/core/deploying/trimming/incompatibilities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following table lists popular reflection-based serializers and their recomme
2020
| Serializers | Alternative |
2121
| :-- | :---------: |
2222
| **Newtonsoft.Json** | [Source generated `System.Text.Json`](../../../standard/serialization/system-text-json/source-generation.md) |
23-
| **System.Configuration.ConfigurationManager** | [Configuration-binding source generator](../../whats-new/dotnet-8.md#configuration-binding-source-generator) |
23+
| **System.Configuration.ConfigurationManager** | [Configuration-binding source generator](../../whats-new/dotnet-8/runtime.md#configuration-binding-source-generator) |
2424
| **System.Runtime.Serialization.Formatters.Binary.BinaryFormatter** | [Migrate away from BinaryFormatter serialization due to its security and reliability flaws.](../../compatibility/serialization/7.0/binaryformatter-apis-produce-errors.md#recommended-action) |
2525

2626
## Runtime code generation via JIT

docs/core/docker/container-images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ _.NET Framework image repositories:_
125125

126126
## See also
127127

128-
- [What's new in .NET 8: Container images](../whats-new/dotnet-8.md#container-images)
128+
- [What's new in .NET 8: Container images](../whats-new/dotnet-8/containers.md#container-images)
129129
- [New approach for differentiating .NET 8+ images](https://github.com/dotnet/dotnet-docker/discussions/4821)
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: What's new in containers for .NET 8
3+
description: Learn about the new containers features introduced in .NET 8.
4+
titleSuffix: ""
5+
ms.date: 11/14/2023
6+
ms.topic: overview
7+
ms.author: gewarren
8+
author: gewarren
9+
---
10+
# What's new in containers for .NET 8
11+
12+
This article describes new features in containers for .NET 8.
13+
14+
## Container images
15+
16+
The following changes have been made to .NET container images for .NET 8:
17+
18+
- [Generated-image defaults](#generated-image-defaults)
19+
- [Debian 12](#debian-12)
20+
- [Non-root user](#non-root-user)
21+
- [Chiseled Ubuntu images](#chiseled-ubuntu-images)
22+
- [Build multi-platform container images](#build-multi-platform-container-images)
23+
- [ASP.NET composite images](#aspnet-composite-images)
24+
25+
### Generated-image defaults
26+
27+
The new [`non-root` capability](#non-root-user) of the Microsoft .NET containers is now the default, which helps your apps stay secure-by-default. Change this default at any time by setting your own `ContainerUser`.
28+
29+
The default container tag is now `latest`. This default is in line with other tooling in the containers space and makes containers easier to use in inner development loops.
30+
31+
### Debian 12
32+
33+
The container images now use [Debian 12 (Bookworm)](https://wiki.debian.org/DebianBookworm). Debian is the default Linux distro in the .NET container images.
34+
35+
### Non-root user
36+
37+
Images include a `non-root` user. This user makes the images `non-root` capable. To run as `non-root`, add the following line at the end of your Dockerfile (or a similar instruction in your Kubernetes manifests):
38+
39+
```dockerfile
40+
USER app
41+
```
42+
43+
.NET 8 adds an environment variable for the UID for the `non-root` user, which is 64198. This environment variable is useful for the Kubernetes `runAsNonRoot` test, which requires that the container user be set via UID and not by name. This [dockerfile](https://github.com/dotnet/dotnet-docker/blob/e5bc76bca49a1bbf9c11e74a590cf6a9fe9dbf2a/samples/aspnetapp/Dockerfile.alpine-non-root#L27) shows an example usage.
44+
45+
The default port also changed from port `80` to `8080`. To support this change, a new environment variable `ASPNETCORE_HTTP_PORTS` is available to make it easier to change ports. The variable accepts a list of ports, which is simpler than the format required by `ASPNETCORE_URLS`. If you change the port back to port `80` using one of these variables, you can't run as `non-root`.
46+
47+
### Chiseled Ubuntu images
48+
49+
[Chiseled Ubuntu images](https://hub.docker.com/r/ubuntu/dotnet-deps) are available for .NET 8. Chiseled images have a reduced attacked surface because they're ultra-small, have no package manager or shell, and are `non-root`. This type of image is for developers who want the benefit of appliance-style computing. Chiseled images are published to the [.NET nightly artifact registry](https://mcr.microsoft.com/product/dotnet/nightly/aspnet/tags).
50+
51+
### Build multi-platform container images
52+
53+
Docker supports using and building [multi-platform images](https://docs.docker.com/build/building/multi-platform/) that work across multiple environments. .NET 8 introduces a new pattern that enables you to mix and match architectures with the .NET images you build. As an example, if you're using macOS and want to target an x64 cloud service in Azure, you can build the image by using the `--platform` switch as follows:
54+
55+
`docker build --pull -t app --platform linux/amd64`
56+
57+
The .NET SDK now supports `$TARGETARCH` values and the `-a` argument on restore. The following code snippet shows an example:
58+
59+
```dockerfile
60+
RUN dotnet restore -a $TARGETARCH
61+
62+
# Copy everything else and build app.
63+
COPY aspnetapp/. .
64+
RUN dotnet publish -a $TARGETARCH --self-contained false --no-restore -o /app
65+
```
66+
67+
For more information, see the [Improving multi-platform container support](https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/) blog post.
68+
69+
### ASP.NET composite images
70+
71+
As part of an effort to improve containerization performance, new ASP.NET Docker images are available that have a composite version of the runtime. This composite is built by compiling multiple MSIL assemblies into a single ready-to-run (R2R) output binary. Because these assemblies are embedded into a single image, jitting takes less time, and the startup performance of apps improves. The other big advantage of the composite over the regular ASP.NET image is that the composite images have a smaller size on disk.
72+
73+
There is a caveat to be aware of. Since composites have multiple assemblies embedded into one, they have tighter version coupling. Apps can't use custom versions of framework or ASP.NET binaries.
74+
75+
Composite images are available for the Alpine Linux, Jammy Chiseled, and Mariner Distroless platforms from the `mcr.microsoft.com/dotnet/nightly/aspnet` repo. The tags are listed with the `-composite` suffix on the [ASP.NET Docker page](https://hub.docker.com/_/microsoft-dotnet-nightly-aspnet).
76+
77+
## Container publishing
78+
79+
- [Performance and compatibility](#performance-and-compatibility)
80+
- [Authentication](#authentication)
81+
- [Publish to tar.gz archive](#publish-to-targz-archive)
82+
83+
### Performance and compatibility
84+
85+
.NET 8 has improved performance for pushing containers to remote registries, especially Azure registries. Speedup comes from pushing layers in one operation and, for registries that don't support atomic uploads, a more reliable chunking mechanism.
86+
87+
These improvements also mean that more registries are supported: Harbor, Artifactory, Quay.io, and Podman.
88+
89+
### Authentication
90+
91+
.NET 8 adds support for OAuth token exchange authentication (Azure Managed Identity) when pushing containers to registries. This support means that you can now push to registries like Azure Container Registry without any authentication errors. The following commands show an example publishing flow:
92+
93+
```console
94+
> az acr login -n <your registry name>
95+
> dotnet publish -r linux-x64 -p PublishProfile=DefaultContainer
96+
```
97+
98+
For more information containerizing .NET apps, see [Containerize a .NET app with dotnet publish](../../docker/publish-as-container.md).
99+
100+
### Publish to tar.gz archive
101+
102+
Starting in .NET 8, you can create a container directly as a *tar.gz* archive. This feature is useful if your workflow isn't straightforward and requires that you, for example, run a scanning tool over your images before pushing them. Once the archive is created, you can move it, scan it, or load it into a local Docker toolchain.
103+
104+
To publish to an archive, add the `ContainerArchiveOutputPath` property to your `dotnet publish` command, for example:
105+
106+
```dotnetcli
107+
dotnet publish \
108+
-p PublishProfile=DefaultContainer \
109+
-p ContainerArchiveOutputPath=./images/sdk-container-demo.tar.gz
110+
```
111+
112+
You can specify either a folder name or a path with a specific file name.
113+
114+
## See also
115+
116+
- [What's new in .NET 8](overview.md)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: What's new in .NET 8
3+
description: Learn about the new .NET features introduced in .NET 8.
4+
titleSuffix: ""
5+
ms.date: 11/14/2023
6+
ms.topic: overview
7+
ms.author: gewarren
8+
author: gewarren
9+
---
10+
# What's new in .NET 8
11+
12+
.NET 8 is the successor to [.NET 7](../dotnet-7.md). It will be [supported for three years](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) as a long-term support (LTS) release. You can [download .NET 8 here](https://dotnet.microsoft.com/download/dotnet).
13+
14+
## .NET runtime
15+
16+
The .NET 8 runtime includes improvements to performance, garbage collection, and the core and extension libraries. It also includes a new globalization mode for mobile apps and new source generators for COM interop and configuration binding. For more information, see [What's new in the .NET 8 runtime](runtime.md).
17+
18+
## .NET SDK
19+
20+
For information about what's new in the .NET SDK, Native AOT, code analysis, and diagnostics, see [What's new in the SDK and tooling for .NET 8](sdk.md).
21+
22+
## C# 12
23+
24+
C# 12 shipped with the .NET 8 SDK. For more information, see [What's new in C# 12](../../../csharp/whats-new/csharp-12.md).
25+
26+
## .NET Aspire
27+
28+
.NET Aspire is an opinionated, cloud-ready stack for building observable, production ready, distributed applications.​ .NET Aspire is delivered through a collection of NuGet packages that handle specific cloud-native concerns, and is available in preview for .NET 8. For more information, see [.NET Aspire (Preview)](/dotnet/aspire).
29+
30+
## ASP.NET Core
31+
32+
ASP.NET Core includes improvements to Blazor, SignalR, minimal APIs, Native AOT, Kestrel and HTTP.sys servers, and authentication and authorization. For more information, see [What's new in ASP.NET Core 8.0](/aspnet/core/release-notes/aspnetcore-8.0).
33+
34+
## .NET MAUI
35+
36+
.NET MAUI includes new functionality for controls, gesture recognizers, Windows apps, navigation, and platform integration. It also includes some behavior changes and many performance enhancements. For more information, see [What's new in .NET MAUI for .NET 8](/dotnet/maui/whats-new/dotnet-8).
37+
38+
## EF Core
39+
40+
Entity Framework Core includes improvements to complex type objects, collections of primitive types, JSON column mapping, raw SQL queries, lazy loading, tracked-entity access, model building, math translations, and other features. It also includes a new `HierarchyId` type. For more information, see [What's New in EF Core 8](/ef/core/what-is-new/ef-core-8.0/whatsnew).
41+
42+
## Windows Forms
43+
44+
Windows Forms includes improvements to data binding, Visual Studio DPI, and high DPI. Button commands are also fully enabled now. For more information, see [What's new for .NET 8 (Windows Forms)](/dotnet/desktop/winforms/whats-new/net80).
45+
46+
## Windows Presentation Foundation
47+
48+
Windows Presentation Foundation (WPF) adds the ability to use hardware acceleration and a new <xref:Microsoft.Win32.OpenFolderDialog> control. For more information, see [What's new in WPF for .NET 8](/dotnet/desktop/wpf/whats-new/net80).
49+
50+
## See also
51+
52+
- [Breaking changes in .NET 8](../../compatibility/8.0.md)
53+
54+
### .NET preview announcements
55+
56+
- [Announcing .NET 8](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8/)
57+
- [Announcing .NET 8 RC 2](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-rc2/)
58+
- [Announcing .NET 8 RC 1](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-rc1/)
59+
- [Announcing .NET 8 Preview 7](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-7/)
60+
- [Announcing .NET 8 Preview 6](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-6/)
61+
- [Announcing .NET 8 Preview 5](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-5/)
62+
- [Announcing .NET 8 Preview 4](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-4/)
63+
- [Announcing .NET 8 Preview 3](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-3/)
64+
- [Announcing .NET 8 Preview 2](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-2/)
65+
- [Announcing .NET 8 Preview 1](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-1/)
66+
67+
### ASP.NET Core preview announcements
68+
69+
- [ASP.NET Core in .NET 8](https://devblogs.microsoft.com/dotnet/announcing-asp-net-core-in-dotnet-8)
70+
- [ASP.NET Core updates in .NET 8 RC 2](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-rc-2/)
71+
- [ASP.NET Core updates in .NET 8 RC 1](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-rc-1/)
72+
- [ASP.NET Core updates in .NET 8 Preview 7](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-7/)
73+
- [ASP.NET Core updates in .NET 8 Preview 6](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-6/)
74+
- [ASP.NET Core updates in .NET 8 Preview 5](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-5/)
75+
- [ASP.NET Core updates in .NET 8 Preview 4](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-4/)
76+
- [ASP.NET Core updates in .NET 8 Preview 3](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-3/)
77+
- [ASP.NET Core updates in .NET 8 Preview 2](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-2/)
78+
- [ASP.NET Core updates in .NET 8 Preview 1](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-1/)

0 commit comments

Comments
 (0)