You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: "Breaking change: Warning emitted for .NET Standard 1.x targets"
3
+
description: Learn about a breaking change in the .NET 9 SDK where the a build warning is produced if your project targets any .NET Standard version below 2.0.
4
+
ms.date: 07/09/2024
5
+
---
6
+
# Warning emitted for .NET Standard 1.x targets
7
+
8
+
A warning is now emitted when a project that targets `netstandard1.x` is built with the .NET 9+ SDK.
9
+
10
+
## Previous behavior
11
+
12
+
Previously, you could build a project that targeted .NET Standard 1.0 - .NET Standard 1.6 without any build warnings.
13
+
14
+
## New behavior
15
+
16
+
Starting in .NET 9, if you build a project that targets .NET Standard 1.0 - .NET Standard 1.6, the following warning is emitted:
17
+
18
+
> warning NETSDK1215: Targeting .NET Standard prior to 2.0 is no longer recommended. See <https://aka.ms/dotnet/dotnet-standard-guidance> for more details.
19
+
20
+
## Version introduced
21
+
22
+
.NET 9 Preview 6
23
+
24
+
## Type of breaking change
25
+
26
+
This change can affect [source compatibility](../../categories.md#source-compatibility).
27
+
28
+
## Reason for change
29
+
30
+
The build warning was introduced to encourage customers to target .NET Standard 2.0 or .NET 6+. If you target .NET Standard 1.x, you're limiting yourself to a subset of .NET Framework 4.5, which is over 10 years old. A lot of innovation has happened since then that you're missing out on. In addition, .NET Standard 1.x is distributed as a granular set of NuGet packages, which creates a large package dependency graph and results in a lot of packages being downloaded when the project is built.
31
+
32
+
For more information, see [What is the downside of targeting .NET Standard 1.x?](https://github.com/dotnet/designs/blob/main/accepted/2024/net-standard-recommendation.md#what-is-the-downside-of-targeting-net-standard-1x).
33
+
34
+
## Recommended action
35
+
36
+
Update your `TargetFramework` property to `netstandard2.0` or `netstandard2.1`.
37
+
38
+
If you must stay on an older .NET Standard version, you can set `<CheckNotRecommendedTargetFramework>` to `false` in your project file (for example, *.csproj* file) or *Directory.Build.props* file to skip the target framework version check:
title: "Breaking change: `installer` repo version no longer included in `productcommits` files"
3
+
description: Learn about a breaking change in the .NET 9 SDK where the `installer` repo commit and version are no longer included in the `productcommits` files.
4
+
ms.date: 07/09/2024
5
+
---
6
+
# `installer` repo version no longer included in `productcommits` files
7
+
8
+
The version and commit of a subset of the repos that comprise .NET are available in the *productcommits-rid.txt* and *.json* files. These files can be queried from aka.ms links, for example, <https://aka.ms/dotnet/9.0.1xx/daily/productCommit-win-x64.txt>. The files enable customers to get the version and commit of the `runtime`, `aspnetcore`, `windowsdesktop`, and `sdk` repos included in a given build. Some customers have built tooling around this file to help others update their repos to new versions of .NET as builds are available.
9
+
10
+
In .NET 9, the `dotnet/installer` repo has been merged into the `dotnet/sdk` repo and builds are now shipped exclusively out of the `dotnet/sdk` repo.
11
+
12
+
## Previous behavior
13
+
14
+
Previously, the *productcommits-rid.txt* file included the `installer` repo version.
15
+
16
+
## New behavior
17
+
18
+
Starting in .NET 9, the `installer` line has been removed from the *productcommits-rid.txt* file.
19
+
20
+
## Version introduced
21
+
22
+
.NET 9 Preview 5
23
+
24
+
## Type of breaking change
25
+
26
+
This change is a [behavioral change](../../categories.md#behavioral-change).
27
+
28
+
## Reason for change
29
+
30
+
The `installer` repo was removed to reduce code-flow time and complexity of builds, and to allow the team to build a full SDK out of the `sdk` repo for testing.
31
+
32
+
## Recommended action
33
+
34
+
Any tooling that depends on the `productcommit` file should be updated to use the `sdk` version.
Copy file name to clipboardExpand all lines: docs/standard/net-standard.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: .NET Standard
3
3
description: Learn about .NET Standard, its versions, and the .NET implementations that support it.
4
-
ms.date: 11/15/2023
4
+
ms.date: 07/09/2024
5
5
ms.service: dotnet
6
6
ms.subservice: standard-library
7
7
ms.custom: "updateeachrelease"
@@ -20,7 +20,10 @@ For information about choosing between .NET 5+ and .NET Standard, see [.NET 5+ a
20
20
21
21
If you're targeting .NET Standard, we recommend you target .NET Standard 2.0, unless you need to support an earlier version. Most general-purpose libraries should not need APIs outside of .NET Standard 2.0, and .NET Framework doesn't support .NET Standard 2.1. .NET Standard 2.0 is supported by all modern platforms and is the recommended way to support multiple platforms with one target.
22
22
23
-
If you need to support .NET Standard 1.x, we recommend that you *also* target .NET Standard 2.0. .NET Standard 1.x is distributed as a granular set of NuGet packages, which creates a large package dependency graph and results in developers downloading a lot of packages when building. For more information, see [Cross-platform targeting](library-guidance/cross-platform-targeting.md) and [.NET 5+ and .NET Standard](#net-5-and-net-standard) later in this article.
23
+
If you need to support .NET Standard 1.x, we recommend that you *also* target .NET Standard 2.0. .NET Standard 1.x is distributed as a granular set of NuGet packages, which creates a large package dependency graph and results in a lot of packages being downloaded when the project is built. For more information, see [Cross-platform targeting](library-guidance/cross-platform-targeting.md) and [.NET 5+ and .NET Standard](#net-5-and-net-standard) later in this article.
24
+
25
+
> [!NOTE]
26
+
> Starting in .NET 9, a build warning is emitted if your project targets .NET Standard 1.x. For more information, see [Warning emitted for .NET Standard 1.x targets](../core/compatibility/sdk/9.0/netstandard-warning.md).
24
27
25
28
### .NET Standard versioning rules
26
29
@@ -85,7 +88,7 @@ If you only need to consume .NET Standard 2.0 libraries in your projects, you ca
85
88
86
89
## .NET 5+ and .NET Standard
87
90
88
-
.NET 5, .NET 6, .NET 7, and .NET 8 are single products with a uniform set of capabilities and APIs that can be used for Windows desktop apps and cross-platform console apps, cloud services, and websites. The .NET 8 [TFMs](frameworks.md), for example, reflect this broad range of scenarios:
91
+
.NET 5, .NET 6, .NET 7, .NET 8, and .NET 9 are single products with a uniform set of capabilities and APIs that can be used for Windows desktop apps and cross-platform console apps, cloud services, and websites. The .NET 8 [TFMs](frameworks.md), for example, reflect this broad range of scenarios:
89
92
90
93
-`net8.0`
91
94
@@ -95,9 +98,12 @@ If you only need to consume .NET Standard 2.0 libraries in your projects, you ca
95
98
96
99
This is an example of an [OS-specific TFM](frameworks.md#net-5-os-specific-tfms) that add OS-specific functionality to everything that `net8.0` refers to.
97
100
98
-
### When to target net8.0 vs. netstandard
101
+
### When to target `net8.0` vs. `netstandard`
102
+
103
+
For existing code that targets .NET Standard 2.0 or later, there's no need to change the TFM to `net8.0` or a later TFM. .NET 8 implements .NET Standard 2.1 and earlier. The only reason to retarget from .NET Standard to .NET 8+ would be to gain access to more runtime features, language features, or APIs. For example, to use C# 9, you need to target .NET 5 or a later version. You can multitarget .NET 8 and .NET Standard to get access to newer features and still have your library available to other .NET implementations.
99
104
100
-
For existing code that targets `netstandard`, there's no need to change the TFM to `net8.0` or a later TFM. .NET 8 implements .NET Standard 2.1 and earlier. The only reason to retarget from .NET Standard to .NET 8+ would be to gain access to more runtime features, language features, or APIs. For example, in order to use C# 9, you need to target .NET 5 or a later version. You can multitarget .NET 8 and .NET Standard to get access to newer features and still have your library available to other .NET implementations.
105
+
> [!NOTE]
106
+
> If your project targets .NET Standard 1.x, we recommend you retarget it to .NET Standard 2.0 or .NET 6+. For more information, see [Warning emitted for .NET Standard 1.x targets](../core/compatibility/sdk/9.0/netstandard-warning.md).
101
107
102
108
Here are some guidelines for new code for .NET 5+:
0 commit comments