From 4ddb84e063a1bf75c77e131734ea20d7f554774e Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 16:40:00 -0700 Subject: [PATCH 01/15] Add initial design document for parsing `net10` --- accepted/2024/net10.md | 51 ++++++++++++++++++++++++++++++++++++++++++ designs.sln | 30 +++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 accepted/2024/net10.md create mode 100644 designs.sln diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md new file mode 100644 index 000000000..994628d7f --- /dev/null +++ b/accepted/2024/net10.md @@ -0,0 +1,51 @@ +# Parsing `net10` + +**Owner** [Immo Landwerth](https://github.com/terrjobst) + +NuGet's framework name parser is fairly old and stems from a world where only +.NET Framework exists. In fact, the early versions of NuGet didn't even support +targeting different versions of .NET Framework. + +In this world, version numbers were represented without periods, for example, +`net20` would be .NET Framework 2.0 while `net35` referred to .NET Framework +3.5. + +And here lies the problem: next year we're shipping .NET 10. It's reasonable for people to put `net10` in the project file. This will produce some interesting error messages: + +> **error MSB3645**: .NET Framework v3.5 Service Pack 1 was not found. In order to target ".NETFramework,Version=v1.0", .NET Framework v3.5 Service Pack 1 or later must be installed. +> +> **error MSB3644**: The reference assemblies for .NETFramework,Version=v1.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks + +It's not exactly terrible, but many people will find this confusing as it's not +obvious that the fix is to change the framework from `net10` to `net10.0`. + +This document proposes how to address this. + +## Stakeholders and Reviewers + +* NuGet team +* MSBuild/SDK team +* VS project system team + +## Design + +Considering that .NET Framework 1.0 is out of support for a while and Visual +Studio doesn't even support building for anything older than .NET Framework 2.0, +it seems very doable to make `net10` mean .NET 10. The question is what happens +with all the other frameworks, such as `net20`, `net452` etc. Quite a few of +those are still supported and actively used. + +Here is the proposal: + +* Make `net10` mean .NET 10 but keep all higher versions as-is (`net20` still + means .NET Framework 2.0). +* The .NET SDK produces a warning if the `` property doesn't + contain a period. + +This results in two things: + +1. Existing behaviors won't change +2. People making the mistake today don't get unintelligible errors which makes + the warning more visible + +The next version where this is a problem is .NET 20, which will ship in 2035 (assuming we keep the schedule). I think 10 years of warning people to include a period ought to be enough to avoid this problem. In fact, we should consider making omitting a version number a build break in, say, .NET 12. diff --git a/designs.sln b/designs.sln new file mode 100644 index 000000000..2b35d0ec9 --- /dev/null +++ b/designs.sln @@ -0,0 +1,30 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{DEA172D1-1AA4-42C0-8223-6675EF7A9370}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "update-index", "tools\update-index\update-index.csproj", "{924FF7A3-0DE0-4B94-9866-692E42E52C1E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {924FF7A3-0DE0-4B94-9866-692E42E52C1E} = {DEA172D1-1AA4-42C0-8223-6675EF7A9370} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {290A8683-629F-4DA4-960B-6A4F3E48C427} + EndGlobalSection +EndGlobal From cfd1730b0394d8ee8f36d0dff1771be2997ae134 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 16:41:40 -0700 Subject: [PATCH 02/15] Remove design.sln, thanks VS Code --- designs.sln | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 designs.sln diff --git a/designs.sln b/designs.sln deleted file mode 100644 index 2b35d0ec9..000000000 --- a/designs.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{DEA172D1-1AA4-42C0-8223-6675EF7A9370}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "update-index", "tools\update-index\update-index.csproj", "{924FF7A3-0DE0-4B94-9866-692E42E52C1E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {924FF7A3-0DE0-4B94-9866-692E42E52C1E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {924FF7A3-0DE0-4B94-9866-692E42E52C1E} = {DEA172D1-1AA4-42C0-8223-6675EF7A9370} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {290A8683-629F-4DA4-960B-6A4F3E48C427} - EndGlobalSection -EndGlobal From af61cefd5d8cfed5e8bd614c948746f13192b68e Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 16:51:25 -0700 Subject: [PATCH 03/15] Update index --- INDEX.md | 1 + 1 file changed, 1 insertion(+) diff --git a/INDEX.md b/INDEX.md index 9aa18f133..66598d267 100644 --- a/INDEX.md +++ b/INDEX.md @@ -86,6 +86,7 @@ Use update-index to regenerate it: | 2023 | [Multi-threading on a browser](accepted/2023/wasm-browser-threads.md) | [Pavel Savara](https://github.com/pavelsavara) | | 2023 | [net8.0-browser TFM for applications running in the browser](accepted/2023/net8.0-browser-tfm.md) | [Javier Calvarro](https://github.com/javiercn) | | 2024 | [.NET Standard Targeting Recommendations](accepted/2024/net-standard-recommendation.md) | [Immo Landwerth](https://github.com/terrajobst), [Viktor Hofer](https://github.com/ViktorHofer) | +| 2024 | [Parsing `net10`](accepted/2024/net10.md) | [Immo Landwerth](https://github.com/terrjobst) | ## Drafts From 458cfca305d9076af7b146418dc9f6ca884ee4b3 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 17:02:29 -0700 Subject: [PATCH 04/15] Apply the same logic to `net11` --- accepted/2024/net10.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index 994628d7f..f1938f924 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -37,8 +37,8 @@ those are still supported and actively used. Here is the proposal: -* Make `net10` mean .NET 10 but keep all higher versions as-is (`net20` still - means .NET Framework 2.0). +* Make `net10` mean .NET 10 and `net11` mean .NET 11 but keep all higher + versions as-is (`net20` still means .NET Framework 2.0). * The .NET SDK produces a warning if the `` property doesn't contain a period. @@ -48,4 +48,7 @@ This results in two things: 2. People making the mistake today don't get unintelligible errors which makes the warning more visible -The next version where this is a problem is .NET 20, which will ship in 2035 (assuming we keep the schedule). I think 10 years of warning people to include a period ought to be enough to avoid this problem. In fact, we should consider making omitting a version number a build break in, say, .NET 12. +The next version where this is a problem is .NET 20, which will ship in 2035 +(assuming we keep the schedule). I think 10 years of warning people to include a +period ought to be enough to avoid this problem. In fact, we should consider +making omitting a version number a build break in, say, .NET 12. From d6f7978005d03ceb107ba15ac7e8dc5de327bdb1 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 17:04:21 -0700 Subject: [PATCH 05/15] Fix word wrapping --- accepted/2024/net10.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index f1938f924..dc488e899 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -10,11 +10,19 @@ In this world, version numbers were represented without periods, for example, `net20` would be .NET Framework 2.0 while `net35` referred to .NET Framework 3.5. -And here lies the problem: next year we're shipping .NET 10. It's reasonable for people to put `net10` in the project file. This will produce some interesting error messages: +And here lies the problem: next year we're shipping .NET 10. It's reasonable for +people to put `net10` in the project file. This will produce some interesting +error messages: -> **error MSB3645**: .NET Framework v3.5 Service Pack 1 was not found. In order to target ".NETFramework,Version=v1.0", .NET Framework v3.5 Service Pack 1 or later must be installed. +> **error MSB3645**: .NET Framework v3.5 Service Pack 1 was not found. In order +> to target ".NETFramework,Version=v1.0", .NET Framework v3.5 Service Pack 1 or +> later must be installed. > -> **error MSB3644**: The reference assemblies for .NETFramework,Version=v1.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks +> **error MSB3644**: The reference assemblies for .NETFramework,Version=v1.0 +> were not found. To resolve this, install the Developer Pack (SDK/Targeting +> Pack) for this framework version or retarget your application. You can +> download .NET Framework Developer Packs at +> https://aka.ms/msbuild/developerpacks It's not exactly terrible, but many people will find this confusing as it's not obvious that the fix is to change the framework from `net10` to `net10.0`. From 50ea10720c1c6e64fd7dff615586f443a188b701 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 19:15:28 -0700 Subject: [PATCH 06/15] Fix my own user name Co-authored-by: Kexy Biscuit --- accepted/2024/net10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index dc488e899..a1a701a1f 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -1,6 +1,6 @@ # Parsing `net10` -**Owner** [Immo Landwerth](https://github.com/terrjobst) +**Owner** [Immo Landwerth](https://github.com/terrajobst) NuGet's framework name parser is fairly old and stems from a world where only .NET Framework exists. In fact, the early versions of NuGet didn't even support From 86ee7e1735491fc671dbc3066634aabcaf231faa Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 19:15:48 -0700 Subject: [PATCH 07/15] Continue fixing my own username Co-authored-by: Kexy Biscuit --- INDEX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INDEX.md b/INDEX.md index 66598d267..c26ce4e75 100644 --- a/INDEX.md +++ b/INDEX.md @@ -86,7 +86,7 @@ Use update-index to regenerate it: | 2023 | [Multi-threading on a browser](accepted/2023/wasm-browser-threads.md) | [Pavel Savara](https://github.com/pavelsavara) | | 2023 | [net8.0-browser TFM for applications running in the browser](accepted/2023/net8.0-browser-tfm.md) | [Javier Calvarro](https://github.com/javiercn) | | 2024 | [.NET Standard Targeting Recommendations](accepted/2024/net-standard-recommendation.md) | [Immo Landwerth](https://github.com/terrajobst), [Viktor Hofer](https://github.com/ViktorHofer) | -| 2024 | [Parsing `net10`](accepted/2024/net10.md) | [Immo Landwerth](https://github.com/terrjobst) | +| 2024 | [Parsing `net10`](accepted/2024/net10.md) | [Immo Landwerth](https://github.com/terrajobst) | ## Drafts From cc3bce5bba5b73ffbc86ea94038abe99ee520662 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Wed, 2 Oct 2024 19:21:09 -0700 Subject: [PATCH 08/15] Add clarification for `net10.0` --- accepted/2024/net10.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index a1a701a1f..ab83b1c73 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -60,3 +60,16 @@ The next version where this is a problem is .NET 20, which will ship in 2035 (assuming we keep the schedule). I think 10 years of warning people to include a period ought to be enough to avoid this problem. In fact, we should consider making omitting a version number a build break in, say, .NET 12. + +## Q & A + +### What about `net10.0` + +That is the preferred syntax and will continue to work. The point of this work +is not to make `net10` work because it's nicer -- it's to promote "framework +names should be specified with a period", but we don't want to make this an +error (because many, many people use `net472` today) but a warning. However, +when using `net10` will most likely fail because the SDK doesn't support +targeting it, which will drown out the warning telling you to use period. +Failing it only for `net10` would be possible but feel odd because we'd prefer +periods for all framework names, not just for `net10.0`. From 07a1cd83a8dcac0f3ec542b64f819006a2593b42 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Thu, 3 Oct 2024 10:34:19 -0700 Subject: [PATCH 09/15] Include usage of specific TFM syntax --- accepted/2024/net10.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index ab83b1c73..a73da1a7c 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -61,6 +61,23 @@ The next version where this is a problem is .NET 20, which will ship in 2035 period ought to be enough to avoid this problem. In fact, we should consider making omitting a version number a build break in, say, .NET 12. +### Usage + +| LinkText | Hits | +| --------------------------------------------------------------------------------------------------------- | ---- | +| [net5](https://github.com/search?q=net5%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 916 | +| [net6](https://github.com/search?q=net6%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 2.3k | +| [net7](https://github.com/search?q=net7%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 520 | +| [net8](https://github.com/search?q=net8%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 704 | +| [net9](https://github.com/search?q=net9%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 9 | +| [net5.0](https://github.com/search?q=net5.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 142k | +| [net6.0](https://github.com/search?q=net6.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 436k | +| [net7.0](https://github.com/search?q=net7.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 138k | +| [net8.0](https://github.com/search?q=net8.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 381k | +| [net9.0](https://github.com/search?q=net9.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 4.3k | +| [netstandard2](https://github.com/search?q=netstandard2%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 83 | +| [netstandard2.0](https://github.com/search?q=netstandard2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 132k | + ## Q & A ### What about `net10.0` From 8bf49f815645120c659b1eb11c8581c49b521994 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Thu, 3 Oct 2024 10:34:57 -0700 Subject: [PATCH 10/15] Format TFM as code --- accepted/2024/net10.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index a73da1a7c..6ad29aa60 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -63,20 +63,20 @@ making omitting a version number a build break in, say, .NET 12. ### Usage -| LinkText | Hits | -| --------------------------------------------------------------------------------------------------------- | ---- | -| [net5](https://github.com/search?q=net5%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 916 | -| [net6](https://github.com/search?q=net6%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 2.3k | -| [net7](https://github.com/search?q=net7%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 520 | -| [net8](https://github.com/search?q=net8%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 704 | -| [net9](https://github.com/search?q=net9%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 9 | -| [net5.0](https://github.com/search?q=net5.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 142k | -| [net6.0](https://github.com/search?q=net6.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 436k | -| [net7.0](https://github.com/search?q=net7.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 138k | -| [net8.0](https://github.com/search?q=net8.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 381k | -| [net9.0](https://github.com/search?q=net9.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 4.3k | -| [netstandard2](https://github.com/search?q=netstandard2%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 83 | -| [netstandard2.0](https://github.com/search?q=netstandard2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 132k | +| GitHub Usage of a Framework | Hits | +| ----------------------------------------------------------------------------------------------------------- | ---: | +| [`net5`](https://github.com/search?q=net5%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 916 | +| [`net6`](https://github.com/search?q=net6%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 2.3k | +| [`net7`](https://github.com/search?q=net7%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 520 | +| [`net8`](https://github.com/search?q=net8%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 704 | +| [`net9`](https://github.com/search?q=net9%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 9 | +| [`net5.0`](https://github.com/search?q=net5.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 142k | +| [`net6.0`](https://github.com/search?q=net6.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 436k | +| [`net7.0`](https://github.com/search?q=net7.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 138k | +| [`net8.0`](https://github.com/search?q=net8.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 381k | +| [`net9.0`](https://github.com/search?q=net9.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 4.3k | +| [`netstandard2`](https://github.com/search?q=netstandard2%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 83 | +| [`netstandard2.0`](https://github.com/search?q=netstandard2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 132k | ## Q & A From ec15fa8eed6662378ed9020c14098f071a3774f4 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Thu, 3 Oct 2024 10:44:06 -0700 Subject: [PATCH 11/15] Make table simpler and add percentages --- accepted/2024/net10.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index 6ad29aa60..1e4a52b3a 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -63,20 +63,27 @@ making omitting a version number a build break in, say, .NET 12. ### Usage -| GitHub Usage of a Framework | Hits | -| ----------------------------------------------------------------------------------------------------------- | ---: | -| [`net5`](https://github.com/search?q=net5%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 916 | -| [`net6`](https://github.com/search?q=net6%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 2.3k | -| [`net7`](https://github.com/search?q=net7%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 520 | -| [`net8`](https://github.com/search?q=net8%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 704 | -| [`net9`](https://github.com/search?q=net9%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 9 | -| [`net5.0`](https://github.com/search?q=net5.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 142k | -| [`net6.0`](https://github.com/search?q=net6.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 436k | -| [`net7.0`](https://github.com/search?q=net7.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 138k | -| [`net8.0`](https://github.com/search?q=net8.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 381k | -| [`net9.0`](https://github.com/search?q=net9.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 4.3k | -| [`netstandard2`](https://github.com/search?q=netstandard2%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 83 | -| [`netstandard2.0`](https://github.com/search?q=netstandard2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code) | 132k | +| GitHub Usage of a Framework | Hits1 | Hits2 | Percent | +| --------------------------------------- | ----: | ----: | ------- | +| [`net5`] vs [`net5.0`] | 916 | 142k | | +| [`net6`] vs [`net6.0`] | 2.3k | 436k | | +| [`net7`] vs [`net7.0`] | 520 | 138k | | +| [`net8`] vs [`net8.0`] | 704 | 381k | | +| [`net9`] vs [`net9.0`] | 9 | 4.3k | | +| [`netstandard2`] vs [`netstandard2.0`] | 83 | 132k | | + +[`net5`]: https://github.com/search?q=net5%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net6`]: https://github.com/search?q=net6%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net7`]: https://github.com/search?q=net7%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net8`]: https://github.com/search?q=net8%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net9`]: https://github.com/search?q=net9%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net5.0`]: https://github.com/search?q=net5.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net6.0`]: https://github.com/search?q=net6.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net7.0`]: https://github.com/search?q=net7.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net8.0`]: https://github.com/search?q=net8.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net9.0`]: https://github.com/search?q=net9.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`netstandard2`]: https://github.com/search?q=netstandard2%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`netstandard2.0`]: https://github.com/search?q=netstandard2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code ## Q & A From 151028cf3c5a7c66b6a22459112390853ec0f041 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Thu, 3 Oct 2024 10:44:38 -0700 Subject: [PATCH 12/15] Forgot to hit save, sigh --- accepted/2024/net10.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index 1e4a52b3a..5e08695e5 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -63,14 +63,14 @@ making omitting a version number a build break in, say, .NET 12. ### Usage -| GitHub Usage of a Framework | Hits1 | Hits2 | Percent | -| --------------------------------------- | ----: | ----: | ------- | -| [`net5`] vs [`net5.0`] | 916 | 142k | | -| [`net6`] vs [`net6.0`] | 2.3k | 436k | | -| [`net7`] vs [`net7.0`] | 520 | 138k | | -| [`net8`] vs [`net8.0`] | 704 | 381k | | -| [`net9`] vs [`net9.0`] | 9 | 4.3k | | -| [`netstandard2`] vs [`netstandard2.0`] | 83 | 132k | | +| GitHub Usage of a Framework | Without `.0` | With `.0` | Percent | +| --------------------------------------- | -----------: | --------: | ------- | +| [`net5`] vs [`net5.0`] | 916 | 142k | 0.6% | +| [`net6`] vs [`net6.0`] | 2.3k | 436k | 0.5% | +| [`net7`] vs [`net7.0`] | 520 | 138k | 0.4% | +| [`net8`] vs [`net8.0`] | 704 | 381k | 0.2% | +| [`net9`] vs [`net9.0`] | 9 | 4.3k | 0.2% | +| [`netstandard2`] vs [`netstandard2.0`] | 83 | 132k | 0.1% | [`net5`]: https://github.com/search?q=net5%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net6`]: https://github.com/search?q=net6%3C%2FTargetFramework%3E+lang%3Axml&type=code From 06b7c601f3cce60b28e971dec648490555ba5f58 Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Thu, 3 Oct 2024 16:10:41 -0700 Subject: [PATCH 13/15] Update data to change proposal to match discussion --- accepted/2024/net10.md | 154 ++++++++++++++++++++++++++++++++++------- 1 file changed, 128 insertions(+), 26 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index 5e08695e5..7cfcf3e19 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -37,54 +37,142 @@ This document proposes how to address this. ## Design -Considering that .NET Framework 1.0 is out of support for a while and Visual -Studio doesn't even support building for anything older than .NET Framework 2.0, -it seems very doable to make `net10` mean .NET 10. The question is what happens -with all the other frameworks, such as `net20`, `net452` etc. Quite a few of -those are still supported and actively used. +We want to steer people towards a proper version syntax, that is + +```xml +netX.Y.Z +``` -Here is the proposal: +Examples include `net9.0`, `net10.0`, `net4.5.1`. This syntax makes it +unambiguous. -* Make `net10` mean .NET 10 and `net11` mean .NET 11 but keep all higher - versions as-is (`net20` still means .NET Framework 2.0). -* The .NET SDK produces a warning if the `` property doesn't - contain a period. +Proposal: -This results in two things: +* Fail the build if the TFM is `net10` or `net11` with an error message + > This framework syntax is unsupported because it's unambiguous. If you mean + > .NET Framework 1.0, use `net1.0`. If you mean .NET 10, use `net10.0`. +* If the TFM is neither `net10` nor `net11`, produce a warning if it doesn't + contain a period: + > This framework syntax is obsolete. You should use periods to separate + > version components. -1. Existing behaviors won't change -2. People making the mistake today don't get unintelligible errors which makes - the warning more visible +The reason to fail the build is because in practice someone trying to target +.NET 10 will most likely fail anyway because the either don't have the .NET +Framework 3.5 targeting pack -- or worse -- they do, but the code doesn't +compile because it's meant for modern .NET Core, not a 25 year old .NET +Framework 1.0. By failing it early it turns an actionable error into something +that makes more sense to the user. -The next version where this is a problem is .NET 20, which will ship in 2035 -(assuming we keep the schedule). I think 10 years of warning people to include a -period ought to be enough to avoid this problem. In fact, we should consider -making omitting a version number a build break in, say, .NET 12. +The reason to issue the warning is to avoid any ambiguities moving forward. + +> [!NOTE] +> +> Please note that this change only applies to the .NET Core SDK, i.e. SDK-style +> projects. Old school .NET Framework CSPROJ files will be unaffected by this +> change because the representation of the target framework is already a proper +> version string. ### Usage -| GitHub Usage of a Framework | Without `.0` | With `.0` | Percent | -| --------------------------------------- | -----------: | --------: | ------- | -| [`net5`] vs [`net5.0`] | 916 | 142k | 0.6% | -| [`net6`] vs [`net6.0`] | 2.3k | 436k | 0.5% | -| [`net7`] vs [`net7.0`] | 520 | 138k | 0.4% | -| [`net8`] vs [`net8.0`] | 704 | 381k | 0.2% | -| [`net9`] vs [`net9.0`] | 9 | 4.3k | 0.2% | -| [`netstandard2`] vs [`netstandard2.0`] | 83 | 132k | 0.1% | +Below is a comparison how much a given TFM syntax is being used on GitHub. As +you can see, for modern TFMs syntax wit an explicit period is most widely used. + +| GitHub Usage of a TFM syntax | `netX` | `netXY` | `netX.Y` | +| ----------------------------------------------------- | -----: | ------- | -------: | +| [`net5`] [`net50`] [`net5.0`] | 916 | 181 | 142k | +| [`net6`] [`net60`] [`net6.0`] | 2.3k | 273 | 436k | +| [`net7`] [`net70`] [`net7.0`] | 520 | 104 | 138k | +| [`net8`] [`net80`] [`net8.0`] | 704 | 46 | 381k | +| [`net9`] [`net90`] [`net9.0`] | 9 | 1 | 4.3k | +| [`netstandard2`] [`netstandard20`] [`netstandard2.0`] | 83 | 148 | 132k | [`net5`]: https://github.com/search?q=net5%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net6`]: https://github.com/search?q=net6%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net7`]: https://github.com/search?q=net7%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net8`]: https://github.com/search?q=net8%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net9`]: https://github.com/search?q=net9%3C%2FTargetFramework%3E+lang%3Axml&type=code + +[`net50`]: https://github.com/search?q=net50%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net60`]: https://github.com/search?q=net60%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net70`]: https://github.com/search?q=net70%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net80`]: https://github.com/search?q=net80%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net90`]: https://github.com/search?q=net90%3C%2FTargetFramework%3E+lang%3Axml&type=code + [`net5.0`]: https://github.com/search?q=net5.0%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net6.0`]: https://github.com/search?q=net6.0%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net7.0`]: https://github.com/search?q=net7.0%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net8.0`]: https://github.com/search?q=net8.0%3C%2FTargetFramework%3E+lang%3Axml&type=code [`net9.0`]: https://github.com/search?q=net9.0%3C%2FTargetFramework%3E+lang%3Axml&type=code + [`netstandard2`]: https://github.com/search?q=netstandard2%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`netstandard20`]: https://github.com/search?q=netstandard20%3C%2FTargetFramework%3E+lang%3Axml&type=code [`netstandard2.0`]: https://github.com/search?q=netstandard2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +For .NET Framework frameworks the most dominant syntax is used is without +periods, which is to be expected given that was the encouraged syntax: + +| GitHub Usage of a TFM syntax | `netX` | `netXY` | `netX.Y` | +| ----------------------------- | -----: | ------: | -------: | +| [`net1`] [`net10`] [`net1.0`] | 0 | 75 | 0 | +| [`net11`] [`net1.1`] | | 1 | 0 | +| [`net2`] [`net20`] [`net2.0`] | 1 | 15k | 6 | +| [`net3`] [`net30`] [`net3.0`] | 0 | 0 | 3 | +| [`net35`] [`net3.5`] | | 42k | 16 | +| [`net4`] [`net40`] [`net4.0`] | 0 | 24k | 26 | +| [`net45`] [`net4.5`] | | 13k | 48 | +| [`net451`] [`net4.5.1`] | | 988 | 3 | +| [`net452`] [`net4.5.2`] | | 35k | 107 | +| [`net46`] [`net4.6`] | | 39k | 17 | +| [`net461`] [`net4.6.1`] | | 84k | 43 | +| [`net462`] [`net4.6.2`] | | 82k | 34 | +| [`net47`] [`net4.7`] | | 13k | 25 | +| [`net471`] [`net4.7.1`] | | 19k | 23 | +| [`net472`] [`net4.7.2`] | | 159k | 146 | +| [`net48`] [`net4.8`] | | 134k | 320 | +| [`net481`] [`net4.8.1`] | | 652 | 37 | + +[`net1`]: https://github.com/search?q=net1%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net2`]: https://github.com/search?q=net2%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net3`]: https://github.com/search?q=net3%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4`]: https://github.com/search?q=net3%3C%2FTargetFramework%3E+lang%3Axml&type=code + +[`net10`]: https://github.com/search?q=net10%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net11`]: https://github.com/search?q=net11%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net20`]: https://github.com/search?q=net20%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net30`]: https://github.com/search?q=net3%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net35`]: https://github.com/search?q=net35%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net40`]: https://github.com/search?q=net40%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net45`]: https://github.com/search?q=net45%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net451`]: https://github.com/search?q=net451%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net452`]: https://github.com/search?q=net452%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net46`]: https://github.com/search?q=net46%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.6`]: https://github.com/search?q=net4.6%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net461`]: https://github.com/search?q=net461%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net462`]: https://github.com/search?q=net462%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net47`]: https://github.com/search?q=net47%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net471`]: https://github.com/search?q=net471%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net472`]: https://github.com/search?q=net472%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net48`]: https://github.com/search?q=net48%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net481`]: https://github.com/search?q=net481%3C%2FTargetFramework%3E+lang%3Axml&type=code + +[`net1.0`]: https://github.com/search?q=net1.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net1.1`]: https://github.com/search?q=net1.1%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net2.0`]: https://github.com/search?q=net2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net3.0`]: https://github.com/search?q=net3.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net3.5`]: https://github.com/search?q=net3.5%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.0`]: https://github.com/search?q=net4.0%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.5`]: https://github.com/search?q=net4.5%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.5.1`]: https://github.com/search?q=net4.5.1%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.5.2`]: https://github.com/search?q=net4.5.2%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.6.1`]: https://github.com/search?q=net4.6.1%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.6.2`]: https://github.com/search?q=net4.6.2%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.7`]: https://github.com/search?q=net4.7%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.7.1`]: https://github.com/search?q=net4.7.1%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.7.2`]: https://github.com/search?q=net4.7.2%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.8`]: https://github.com/search?q=net4.8%3C%2FTargetFramework%3E+lang%3Axml&type=code +[`net4.8.1`]: https://github.com/search?q=net4.8.1%3C%2FTargetFramework%3E+lang%3Axml&type=code + + ## Q & A ### What about `net10.0` @@ -97,3 +185,17 @@ when using `net10` will most likely fail because the SDK doesn't support targeting it, which will drown out the warning telling you to use period. Failing it only for `net10` would be possible but feel odd because we'd prefer periods for all framework names, not just for `net10.0`. + +# Why don't we make `net10` just work work? + +Considering that .NET Framework 1.0 is out of support for a while and Visual +Studio doesn't even support building for anything older than .NET Framework 2.0, +it seems very doable to make `net10` mean .NET 10. + +There are two downsides to this: + +1. It makes a syntax work that we don't want to promote +2. The other (widely used) monikers `net20`, `net452`, `net48`, need to continue + to work and mean what they mean today, which is confusing. +3. It requires changing parsing rules in the NuGet library, which might have + unforeseen ripple effects. From 15801432100d49539a8e930bd200d52d187a907d Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Thu, 3 Oct 2024 16:14:10 -0700 Subject: [PATCH 14/15] Fix typo --- accepted/2024/net10.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index 7cfcf3e19..6f3aca90e 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -60,8 +60,8 @@ The reason to fail the build is because in practice someone trying to target .NET 10 will most likely fail anyway because the either don't have the .NET Framework 3.5 targeting pack -- or worse -- they do, but the code doesn't compile because it's meant for modern .NET Core, not a 25 year old .NET -Framework 1.0. By failing it early it turns an actionable error into something -that makes more sense to the user. +Framework 1.0. By failing it early it turns an unintelligible error message into +something actionable. The reason to issue the warning is to avoid any ambiguities moving forward. From 9f6e21f95a28127336f169daf5df155f338f916c Mon Sep 17 00:00:00 2001 From: Immo Landwerth Date: Thu, 3 Oct 2024 16:15:53 -0700 Subject: [PATCH 15/15] Fix more typos --- accepted/2024/net10.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/accepted/2024/net10.md b/accepted/2024/net10.md index 6f3aca90e..228474ba2 100644 --- a/accepted/2024/net10.md +++ b/accepted/2024/net10.md @@ -75,7 +75,8 @@ The reason to issue the warning is to avoid any ambiguities moving forward. ### Usage Below is a comparison how much a given TFM syntax is being used on GitHub. As -you can see, for modern TFMs syntax wit an explicit period is most widely used. +you can see, for modern TFMs, the syntax with an explicit period is most widely +used. | GitHub Usage of a TFM syntax | `netX` | `netXY` | `netX.Y` | | ----------------------------------------------------- | -----: | ------- | -------: | @@ -108,8 +109,8 @@ you can see, for modern TFMs syntax wit an explicit period is most widely used. [`netstandard20`]: https://github.com/search?q=netstandard20%3C%2FTargetFramework%3E+lang%3Axml&type=code [`netstandard2.0`]: https://github.com/search?q=netstandard2.0%3C%2FTargetFramework%3E+lang%3Axml&type=code -For .NET Framework frameworks the most dominant syntax is used is without -periods, which is to be expected given that was the encouraged syntax: +For .NET Framework, the most dominant TFM syntax is the one without periods, +which is to be expected given that was the encouraged syntax: | GitHub Usage of a TFM syntax | `netX` | `netXY` | `netX.Y` | | ----------------------------- | -----: | ------: | -------: |