Skip to content

Commit dc9d97b

Browse files
committed
updates for .net 9 ga
1 parent 50647e0 commit dc9d97b

13 files changed

+125
-121
lines changed

docs/standard/frameworks.md

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Target frameworks in SDK-style projects - .NET
33
description: Learn about target frameworks for .NET apps and libraries.
4-
ms.date: 12/12/2023
4+
ms.date: 11/11/2024
55
ms.service: dotnet
66
ms.custom: updateeachrelease
77
ms.subservice: standard-library
@@ -26,10 +26,8 @@ The following table defines the most common target frameworks, how they're refer
2626

2727
| Target framework | Latest <br/> stable version | Target framework moniker (TFM) | Implemented <br/> .NET Standard version |
2828
|:----------------:|:---------------------------:|:------------------------------:|:---------------------------------------:|
29+
| .NET 9 | 9 | net9.0 | 2.1 |
2930
| .NET 8 | 8 | net8.0 | 2.1 |
30-
| .NET 7 | 7 | net7.0 | 2.1 |
31-
| .NET 6 | 6 | net6.0 | 2.1 |
32-
| .NET 5 | 5 | net5.0 | 2.1 |
3331
| .NET Standard | 2.1 | netstandard2.1 | N/A |
3432
| .NET Core | 3.1 | netcoreapp3.1 | 2.1 |
3533
| .NET Framework | 4.8.1 | net481 | 2.0 |
@@ -53,52 +51,59 @@ A target framework is typically referenced by a TFM. The following table shows t
5351

5452
### .NET 5+ OS-specific TFMs
5553

56-
The `net5.0`, `net6.0`, `net7.0`, and `net8.0` TFMs include technologies that work across different platforms. Specifying an *OS-specific TFM* makes APIs that are specific to an operating system available to your app, for example, Windows Forms or iOS bindings. OS-specific TFMs also inherit every API available to their base TFM, for example, the `net6.0` TFM.
54+
The `net5.0`, `net6.0`, `net7.0`, `net8.0`, and `net.0` TFMs include technologies that work across different platforms. Specifying an *OS-specific TFM* makes APIs that are specific to an operating system available to your app, for example, Windows Forms or iOS bindings. OS-specific TFMs also inherit every API available to their base TFM, for example, the `net9.0` TFM.
5755

5856
.NET 5 introduced the `net5.0-windows` OS-specific TFM, which includes Windows-specific bindings for WinForms, WPF, and UWP APIs. .NET 6 and later versions have additional OS-specific TFMs, for example, `net6.0-ios`.
5957

6058
The following table shows the compatibility of the .NET 5+ TFMs.
6159

62-
| TFM | Compatible with |
63-
|--------------------|-------------------------------------------------------------------------------------------------------------------------|
60+
| TFM | Compatible with |
61+
|----------------------|------------------------------------------------------------------|
6462
| `net5.0` | net1..4 (with NU1701 warning)<br />netcoreapp1..3.1 (warning when WinForms or WPF is referenced)<br />netstandard1..2.1 |
65-
| `net5.0-windows` | netcoreapp1..3.1 (plus everything else inherited from `net5.0`) |
66-
| `net6.0` | (Subsequent version of `net5.0`) |
67-
| `net6.0-android` | `xamarin.android` (plus everything else inherited from `net6.0`) |
68-
| `net6.0-ios` | Everything inherited from `net6.0` |
69-
| `net6.0-maccatalyst` | Everything inherited from `net6.0` |
70-
| `net6.0-macos` | Everything inherited from `net6.0` |
71-
| `net6.0-tvos` | Everything inherited from `net6.0` |
72-
| `net6.0-windows` | (Subsequent version of `net5.0-windows`) |
73-
| `net7.0` | (Subsequent version of `net6.0`) |
74-
| `net7.0-android` | (Subsequent version of `net6.0-android`) |
75-
| `net7.0-ios` | (Subsequent version of `net6.0-ios`) |
76-
| `net7.0-maccatalyst` | (Subsequent version of `net6.0-maccatalyst`) |
77-
| `net7.0-macos` | (Subsequent version of `net6.0-macos`) |
78-
| `net7.0-tizen` | `tizen40` (plus everything else inherited from `net7.0`) |
79-
| `net7.0-tvos` | (Subsequent version of `net6.0-tvos`) |
80-
| `net7.0-windows` | (Subsequent version of `net6.0-windows`) |
81-
| `net8.0` | (Subsequent version of `net7.0`) |
82-
| `net8.0-android` | (Subsequent version of `net7.0-android`) |
83-
| `net8.0-browser` | Everything inherited from `net8.0` |
84-
| `net8.0-ios` | (Subsequent version of `net7.0-ios`) |
85-
| `net8.0-maccatalyst` | (Subsequent version of `net7.0-maccatalyst`) |
86-
| `net8.0-macos` | (Subsequent version of `net7.0-macos`) |
87-
| `net8.0-tizen` | (Subsequent version of `net7.0-tizen`) |
88-
| `net8.0-tvos` | (Subsequent version of `net7.0-tvos`) |
89-
| `net8.0-windows` | (Subsequent version of `net7.0-windows`) |
63+
| `net5.0-windows` | netcoreapp1..3.1 (plus everything else inherited from `net5.0`) |
64+
| `net6.0` | (Subsequent version of `net5.0`) |
65+
| `net6.0-android` | `xamarin.android` (plus everything else inherited from `net6.0`) |
66+
| `net6.0-ios` | Everything inherited from `net6.0` |
67+
| `net6.0-maccatalyst` | Everything inherited from `net6.0` |
68+
| `net6.0-macos` | Everything inherited from `net6.0` |
69+
| `net6.0-tvos` | Everything inherited from `net6.0` |
70+
| `net6.0-windows` | (Subsequent version of `net5.0-windows`) |
71+
| `net7.0` | (Subsequent version of `net6.0`) |
72+
| `net7.0-android` | (Subsequent version of `net6.0-android`) |
73+
| `net7.0-ios` | (Subsequent version of `net6.0-ios`) |
74+
| `net7.0-maccatalyst` | (Subsequent version of `net6.0-maccatalyst`) |
75+
| `net7.0-macos` | (Subsequent version of `net6.0-macos`) |
76+
| `net7.0-tizen` | `tizen40` (plus everything else inherited from `net7.0`) |
77+
| `net7.0-tvos` | (Subsequent version of `net6.0-tvos`) |
78+
| `net7.0-windows` | (Subsequent version of `net6.0-windows`) |
79+
| `net8.0` | (Subsequent version of `net7.0`) |
80+
| `net8.0-android` | (Subsequent version of `net7.0-android`) |
81+
| `net8.0-browser` | Everything inherited from `net8.0` |
82+
| `net8.0-ios` | (Subsequent version of `net7.0-ios`) |
83+
| `net8.0-maccatalyst` | (Subsequent version of `net7.0-maccatalyst`) |
84+
| `net8.0-macos` | (Subsequent version of `net7.0-macos`) |
85+
| `net8.0-tizen` | (Subsequent version of `net7.0-tizen`) |
86+
| `net8.0-tvos` | (Subsequent version of `net7.0-tvos`) |
87+
| `net8.0-windows` | (Subsequent version of `net7.0-windows`) |
88+
| `net9.0` | (Subsequent version of `net8.0`) |
89+
| `net9.0-android` | (Subsequent version of `net8.0-android`) |
90+
| `net9.0-browser` | (Subsequent version of `net8.0-browser`) |
91+
| `net9.0-ios` | (Subsequent version of `net8.0-ios`) |
92+
| `net9.0-maccatalyst` | (Subsequent version of `net8.0-maccatalyst`) |
93+
| `net9.0-macos` | (Subsequent version of `net8.0-macos`) |
94+
| `net9.0-tizen` | (Subsequent version of `net8.0-tizen`) |
95+
| `net9.0-tvos` | (Subsequent version of `net8.0-tvos`) |
96+
| `net9.0-windows` | (Subsequent version of `net8.0-windows`) |
9097

9198
To make your app portable across different platforms but still have access to OS-specific APIs, you can target multiple OS-specific TFMs and add platform guards around OS-specific API calls using `#if` preprocessor directives. For a list of the available symbols, see [Preprocessor symbols](#preprocessor-symbols).
9299

93100
#### Suggested targets
94101

95102
Use these guidelines to determine which TFM to use in your app:
96103

97-
- Apps that are portable to multiple platforms should target a base TFM, for example, `net8.0`. This includes most libraries but also ASP.NET Core and Entity Framework.
98-
99-
- Platform-specific libraries should target platform-specific flavors. For example, WinForms and WPF projects should target `net8.0-windows`.
100-
101-
- Cross-platform application models (Xamarin Forms, ASP.NET Core) and bridge packs (Xamarin Essentials) should at least target the base TFM, for example, `net8.0`, but might also target additional platform-specific flavors to light-up more APIs or features.
104+
- Apps that are portable to multiple platforms should target a base TFM, for example, `net9.0`. This includes most libraries but also ASP.NET Core and Entity Framework.
105+
- Platform-specific libraries should target platform-specific flavors. For example, WinForms and WPF projects should target `net9.0-windows`.
106+
- Cross-platform application models (Xamarin Forms, ASP.NET Core) and bridge packs (Xamarin Essentials) should at least target the base TFM, for example, `net9.0`, but might also target additional platform-specific flavors to light-up more APIs or features.
102107

103108
#### OS version in TFMs
104109

@@ -110,9 +115,8 @@ The following table shows the default target platform values (TPV) for each .NET
110115

111116
| .NET version | Android | iOS | Mac Catalyst | macOS | tvOS | Tizen | Windows |
112117
|--------------|--------:|-----:|-------------:|------:|-----:|------:|--------:|
113-
| .NET 6 | 31.0 | 15.0 | 15.0 | 12.0 | 15.1 | - | 7.0 |
114-
| .NET 7 | 33.0 | 16.1 | 16.1 | 13.0 | 16.1 | 7.0 | 7.0 |
115-
| .NET 8 | 34.0 | 17.2 | 17.2 | 14.2 | 17.1 | 8.0 | 7.0 |
118+
| .NET 8 | 34.0 | 17.2 | 17.2 | 14.2 | 17.1 | 7.0 | 10.0 |
119+
| .NET 9 | 35.0 | 18.0 | 18.0 | 15.0 | | 7.0 | 10.0 |
116120

117121
> [!NOTE]
118122
> On Apple platforms (iOS, macOS, tvOS, and Mac Catalyst) in .NET 8 and earlier,
@@ -155,14 +159,14 @@ Here is an example excerpt of a project file that uses the `TargetFramework` and
155159

156160
## How to specify a target framework
157161

158-
Target frameworks are specified in a project file. When a single target framework is specified, use the [TargetFramework element](../core/project-sdk/msbuild-props.md#targetframework). The following console app project file demonstrates how to target .NET 8:
162+
Target frameworks are specified in a project file. When a single target framework is specified, use the [TargetFramework element](../core/project-sdk/msbuild-props.md#targetframework). The following console app project file demonstrates how to target .NET 9:
159163

160164
```xml
161165
<Project Sdk="Microsoft.NET.Sdk">
162166

163167
<PropertyGroup>
164168
<OutputType>Exe</OutputType>
165-
<TargetFramework>net8.0</TargetFramework>
169+
<TargetFramework>net9.0</TargetFramework>
166170
</PropertyGroup>
167171

168172
</Project>

docs/standard/library-guidance/cross-platform-targeting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Cross-platform targeting for .NET libraries
33
description: Best practice recommendations for creating cross-platform .NET libraries.
4-
ms.date: 11/14/2023
4+
ms.date: 11/11/2024
55
---
66

77
# Cross-platform targeting
@@ -33,7 +33,7 @@ If your project targets .NET or .NET Standard and compiles successfully, it does
3333
3434
✔️ DO include a `net6.0` target or later if you require new APIs introduced in a modern .NET.
3535

36-
> .NET 6 and later apps can use a `netstandard2.0` target, so `net6.0` isn't required. You should explicitly target `net6.0`, `net7.0`, or `net8.0` when you want to use newer .NET APIs.
36+
> .NET 6 and later apps can use a `netstandard2.0` target, so `net6.0` isn't required. You should explicitly target `net6.0`, `net7.0`, `net8.0`, or `net9.0` when you want to use newer .NET APIs.
3737
3838
❌ AVOID including a `netstandard1.x` target.
3939

0 commit comments

Comments
 (0)