From 372e543b26f752859054b6e04ad2c6b71c3cf18c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 12:34:40 +0000 Subject: [PATCH 01/10] Bump Microsoft.CodeAnalysis.CSharp.Workspaces (#45046) Bumps the dotnet group in /samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart with 1 update: [Microsoft.CodeAnalysis.CSharp.Workspaces](https://github.com/dotnet/roslyn). Updates `Microsoft.CodeAnalysis.CSharp.Workspaces` from 4.12.0 to 4.13.0 - [Release notes](https://github.com/dotnet/roslyn/releases) - [Changelog](https://github.com/dotnet/roslyn/blob/main/docs/Breaking%20API%20Changes.md) - [Commits](https://github.com/dotnet/roslyn/commits) --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.CSharp.Workspaces dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dotnet ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj | 2 +- .../SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj b/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj index d4c81cf17b94b..ab3f2ea9bdb5d 100644 --- a/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj +++ b/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj b/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj index d4c81cf17b94b..ab3f2ea9bdb5d 100644 --- a/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj +++ b/samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj @@ -7,7 +7,7 @@ - + From 4b2ad81ea7c258b9777254a96e53403af4963485 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 07:44:52 -0500 Subject: [PATCH 02/10] Bump actions/upload-artifact from 4.6.0 to 4.6.1 (#45039) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.0 to 4.6.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08...4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scorecards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 6d8b37a6f3698..d5fffe5cbc15d 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -63,7 +63,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 with: name: SARIF file path: results.sarif From 8872dc208f2053bca8a1f0b9d8adf2ab1d30851b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 07:45:13 -0500 Subject: [PATCH 03/10] Bump github/codeql-action from 3.28.9 to 3.28.10 (#45040) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.9 to 3.28.10. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0...b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scorecards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index d5fffe5cbc15d..cf335ffc7da6c 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -71,6 +71,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9 + uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 with: sarif_file: results.sarif From f49da273a3279eac5632db365a0d8294286d08af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Soner=20G=C3=B6n=C3=BCl?= Date: Wed, 26 Feb 2025 15:48:37 +0300 Subject: [PATCH 04/10] Looks like NullArgumentException is a type. Fixed with ArgumentNullException (#45041) --- docs/csharp/whats-new/csharp-14.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/whats-new/csharp-14.md b/docs/csharp/whats-new/csharp-14.md index b9b10f69f8c61..79de1d2d886ed 100644 --- a/docs/csharp/whats-new/csharp-14.md +++ b/docs/csharp/whats-new/csharp-14.md @@ -34,7 +34,7 @@ private string _msg; public string Message { get => _msg; - set => _msg = value ?? throw new NullArgumentException(nameof(value)); + set => _msg = value ?? throw new ArgumentNullException(nameof(value)); } ``` From dc0f173619809aade0e260cc69110ef79b2067bd Mon Sep 17 00:00:00 2001 From: Mariam Abdullah <122357303+mariam-abdulla@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:57:09 +0100 Subject: [PATCH 05/10] Update mtp name in config file (#45030) --- docs/core/tools/dotnet-test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/tools/dotnet-test.md b/docs/core/tools/dotnet-test.md index e48cb940ffe7c..cc10c955f823a 100644 --- a/docs/core/tools/dotnet-test.md +++ b/docs/core/tools/dotnet-test.md @@ -17,7 +17,7 @@ Some examples of the `dotnet.config` file: ```toml [dotnet.test:runner] - name = "MicrosoftTestingPlatform" + name = "Microsoft.Testing.Platform" ``` ```toml From 9772abc8a9fbc221205408725c148d5665bb6632 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 26 Feb 2025 07:48:13 -0800 Subject: [PATCH 06/10] Updates for .slnx files (#45003) --- docs/core/tools/dotnet-sln.md | 80 +++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 17 deletions(-) diff --git a/docs/core/tools/dotnet-sln.md b/docs/core/tools/dotnet-sln.md index dac81d75ac341..c93254980ce0b 100644 --- a/docs/core/tools/dotnet-sln.md +++ b/docs/core/tools/dotnet-sln.md @@ -1,7 +1,7 @@ --- title: dotnet sln command description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file. -ms.date: 05/18/2022 +ms.date: 02/24/2025 --- # dotnet sln @@ -9,7 +9,7 @@ ms.date: 05/18/2022 ## Name -`dotnet sln` - Lists or modifies the projects in a .NET solution file. +`dotnet sln` - Lists or modifies the projects in a .NET solution file, or migrates the file to an *.slnx* file. ## Synopsis @@ -49,7 +49,9 @@ dotnet new sln --output MySolution - **`SOLUTION_FILE`** - The solution file to use. If this argument is omitted, the command searches the current directory for one. If it finds no solution file or multiple solution files, the command fails. + The solution file to use (either an *.sln* or *.slnx* file). + + If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. ## Options @@ -57,6 +59,13 @@ dotnet new sln --output MySolution ## Commands +The following commands are available: + +- [`list`](#list) +- [`add`](#add) +- [`remove`](#remove) +- [`migrate`](#migrate) + ### `list` Lists all projects in a solution file. @@ -71,7 +80,9 @@ dotnet sln list [-h|--help] - **`SOLUTION_FILE`** - The solution file to use. If this argument is omitted, the command searches the current directory for one. If it finds no solution file or multiple solution files, the command fails. + The solution file to use (either an *.sln* or *.slnx* file). + + If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. #### Options @@ -92,7 +103,9 @@ dotnet sln add [-h|--help] - **`SOLUTION_FILE`** - The solution file to use. If it is unspecified, the command searches the current directory for one and fails if there are multiple solution files. + The solution file to use (either an *.sln* or *.slnx* file). + + If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. - **`PROJECT_PATH`** @@ -135,7 +148,9 @@ dotnet sln [] remove [-h|--help] - **`SOLUTION_FILE`** - The solution file to use. If it is unspecified, the command searches the current directory for one and fails if there are multiple solution files. + The solution file to use (either an *.sln* or *.slnx* file). + + If unspecified, the command searches the current directory for an *.sln* or *.slnx* file and, if it finds exactly one, uses that file. If multiple solution files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. - **`PROJECT_PATH`** @@ -145,12 +160,37 @@ dotnet sln [] remove [-h|--help] [!INCLUDE [help](../../../includes/cli-help.md)] +### `migrate` + +Generates an *.slnx* solution file from an *.sln* file. + +#### Synopsis + +```dotnetcli +dotnet sln [] migrate +dotnet sln [] migrate [-h|--help] +``` + +#### Arguments + +- **`SOLUTION_FILE`** + + The *.sln* solution file to migrate. + + If unspecified, the command searches the current directory for an *.sln* file and, if it finds exactly one, uses that file. If multiple *.sln* files are found, the user is prompted to specify a file explicitly. If none are found, the command fails. + + If you specify an *.slnx* file instead of an *.sln* file, or if an *.slnx* file with the same file name (minus the *.sln* extension) already exists in the directory, the command fails. + +#### Options + +[!INCLUDE [help](../../../includes/cli-help.md)] + ## Examples - List the projects in a solution: ```dotnetcli - dotnet sln todo.sln list + dotnet sln todo.slnx list ``` - Add a C# project to a solution: @@ -168,43 +208,49 @@ dotnet sln [] remove [-h|--help] - Add multiple C# projects to the root of a solution: ```dotnetcli - dotnet sln todo.sln add todo-app/todo-app.csproj back-end/back-end.csproj --in-root + dotnet sln todo.slnx add todo-app/todo-app.csproj back-end/back-end.csproj --in-root ``` - Add multiple C# projects to a solution: ```dotnetcli - dotnet sln todo.sln add todo-app/todo-app.csproj back-end/back-end.csproj + dotnet sln todo.slnx add todo-app/todo-app.csproj back-end/back-end.csproj ``` - Remove multiple C# projects from a solution: ```dotnetcli - dotnet sln todo.sln remove todo-app/todo-app.csproj back-end/back-end.csproj + dotnet sln todo.slnx remove todo-app/todo-app.csproj back-end/back-end.csproj ``` - Add multiple C# projects to a solution using a globbing pattern (Unix/Linux only): ```dotnetcli - dotnet sln todo.sln add **/*.csproj + dotnet sln todo.slnx add **/*.csproj ``` - Add multiple C# projects to a solution using a globbing pattern (Windows PowerShell only): ```dotnetcli - dotnet sln todo.sln add (ls -r **/*.csproj) + dotnet sln todo.slnx add (ls -r **/*.csproj) ``` - Remove multiple C# projects from a solution using a globbing pattern (Unix/Linux only): ```dotnetcli - dotnet sln todo.sln remove **/*.csproj + dotnet sln todo.slnx remove **/*.csproj ``` - Remove multiple C# projects from a solution using a globbing pattern (Windows PowerShell only): ```dotnetcli - dotnet sln todo.sln remove (ls -r **/*.csproj) + dotnet sln todo.slnx remove (ls -r **/*.csproj) + ``` + +- Generate an *.slnx* file from a *.sln* file: + + ```dotnetcli + dotnet sln todo.sln migrate ``` - Create a solution, a console app, and two class libraries. Add the projects to the solution, and use the `--solution-folder` option of `dotnet sln` to organize the class libraries into a solution folder. @@ -214,9 +260,9 @@ dotnet sln [] remove [-h|--help] dotnet new console -o myapp dotnet new classlib -o mylib1 dotnet new classlib -o mylib2 - dotnet sln mysolution.sln add myapp\myapp.csproj - dotnet sln mysolution.sln add mylib1\mylib1.csproj --solution-folder mylibs - dotnet sln mysolution.sln add mylib2\mylib2.csproj --solution-folder mylibs + dotnet sln mysolution.slnx add myapp\myapp.csproj + dotnet sln mysolution.slnx add mylib1\mylib1.csproj --solution-folder mylibs + dotnet sln mysolution.slnx add mylib2\mylib2.csproj --solution-folder mylibs ``` The following screenshot shows the result in Visual Studio 2019 **Solution Explorer**: From 3ba1147cb7e1ca3fed952fdb8e15983ba7cde21f Mon Sep 17 00:00:00 2001 From: Aman Khalid Date: Wed, 26 Feb 2025 15:32:34 -0500 Subject: [PATCH 07/10] Fix grammar in overview.md (#45052) --- docs/core/whats-new/dotnet-10/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/whats-new/dotnet-10/overview.md b/docs/core/whats-new/dotnet-10/overview.md index 41a5a137e89a7..8929c79a0e853 100644 --- a/docs/core/whats-new/dotnet-10/overview.md +++ b/docs/core/whats-new/dotnet-10/overview.md @@ -11,7 +11,7 @@ ai-usage: ai-assisted Learn about the new features in .NET 10 and find links to further documentation. This page has been updated for Preview 1. -.NET 10, the successor to [.NET 9](../dotnet-9/overview.md) and will be [supported for 3 years](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) as a long-term support (LTS) release. You can [download .NET 10 here](https://get.dot.net/10). +.NET 10, the successor to [.NET 9](../dotnet-9/overview.md), will be [supported for 3 years](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) as a long-term support (LTS) release. You can [download .NET 10 here](https://get.dot.net/10). Your feedback is important and appreciated. If you have questions or comments, please use the discussion on [GitHub](https://github.com/dotnet/core/discussions/categories/news). From fbfdb86a09003bfe8145a99bca8e1d3a3a670d37 Mon Sep 17 00:00:00 2001 From: Rich Lander Date: Wed, 26 Feb 2025 12:34:02 -0800 Subject: [PATCH 08/10] Update linux.md (#45047) * Update linux.md - Simplify text - Remove reference to Mariner as it is misleading * Update Linux install docs with package policy link --- docs/core/install/linux.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/core/install/linux.md b/docs/core/install/linux.md index 9da43790af8ea..007bf9638e82a 100644 --- a/docs/core/install/linux.md +++ b/docs/core/install/linux.md @@ -19,16 +19,17 @@ This article describes how .NET is available on various Linux distributions. .NE ## Packages -Starting with .NET 9, Microsoft only publishes packages for supported Linux distributions that don't publish their own packages. Packages are published in the Microsoft package repository at . This includes the following Linux distributions: +Packages are available for the following Linux distributions: -- Azure Linux 3.0 +- Azure Linux - [Debian](linux-debian.md) - [openSUSE Leap](linux-opensuse.md) - [SUSE Enterprise Linux](linux-sles.md) -The following Linux distributions officially support .NET, and publish their own .NET packages: +Packages are published in the Microsoft package repository at . Distributions are selected per the policy defined at [dotnet/core #9556](https://github.com/dotnet/core/discussions/9556). + +The following Linux distributions publish their own .NET packages: -- Azure Linux 2.0 (CBL-Mariner) - [Alpine](linux-alpine.md) - [CentOS Stream](linux-rhel.md#centos-stream-9) - [Fedora](linux-fedora.md) From 7cf39a8624863e29363af3be3445b18108bd21a2 Mon Sep 17 00:00:00 2001 From: Stephen Newman Date: Wed, 26 Feb 2025 20:41:27 +0000 Subject: [PATCH 09/10] Correct .NET Aspire - what's new? link (#45027) * Correct .NET Aspire - what's new? link * Apply suggestions from code review --------- Co-authored-by: David Pine --- docs/core/whats-new/dotnet-10/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/whats-new/dotnet-10/overview.md b/docs/core/whats-new/dotnet-10/overview.md index 8929c79a0e853..ccc96d9ff86ab 100644 --- a/docs/core/whats-new/dotnet-10/overview.md +++ b/docs/core/whats-new/dotnet-10/overview.md @@ -43,7 +43,7 @@ For more information, see [What's new in the SDK for .NET 10](sdk.md). .NET Aspire releases version 9.1, which focuses on quality-of-life fixes. -For more information, see [.NET Aspire — what's new?](/dotnet/aspire/whats-new/). +For more information, see [What's new in .NET Aspire 9.1](/dotnet/aspire/whats-new/dotnet-aspire-9.1). ## ASP.NET Core From 2a36a37cff8cb8436557cdd7a013210ef597b9f9 Mon Sep 17 00:00:00 2001 From: Cam Soper Date: Wed, 26 Feb 2025 15:55:09 -0600 Subject: [PATCH 10/10] Breaking change: Ambiguous overloads (#45007) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial commit * lint * Update docs/core/compatibility/core-libraries/9.0/ambiguous-overload.md Co-authored-by: Bill Wagner * Update docs/core/compatibility/core-libraries/9.0/ambiguous-overload.md Co-authored-by: David Cantú * implicit not intrinsic 🤦🏻‍♂️ * Fix suggestion --------- Co-authored-by: Bill Wagner Co-authored-by: David Cantú --- docs/core/compatibility/9.0.md | 123 +++++++++--------- .../core-libraries/9.0/ambiguous-overload.md | 48 +++++++ docs/core/compatibility/toc.yml | 4 + 3 files changed, 114 insertions(+), 61 deletions(-) create mode 100644 docs/core/compatibility/core-libraries/9.0/ambiguous-overload.md diff --git a/docs/core/compatibility/9.0.md b/docs/core/compatibility/9.0.md index 249b1c36ed8d2..c4492a51c035b 100644 --- a/docs/core/compatibility/9.0.md +++ b/docs/core/compatibility/9.0.md @@ -17,58 +17,59 @@ If you're migrating an app to .NET 9, the breaking changes listed here might aff ## ASP.NET Core -| Title | Type of change | Introduced version | -|------------------------------------------------------------------------------------------|---------------------|--------------------| -| [DefaultKeyResolution.ShouldGenerateNewKey has altered meaning](aspnet-core/9.0/key-resolution.md) | Behavioral change | Preview 3 | -| [Dev cert export no longer creates folder](aspnet-core/9.0/certificate-export.md) | Behavioral change | RC 1 | -| [HostBuilder enables ValidateOnBuild/ValidateScopes in development environment](aspnet-core/9.0/hostbuilder-validation.md) | Behavioral change | Preview 7 | -| [Legacy Mono and Emscripten APIs not exported to global namespace](aspnet-core/9.0/legacy-apis.md) | Source incompatible | GA | -| [Middleware types with multiple constructors](aspnet-core/9.0/middleware-constructors.md) | Behavioral change | RC 1 | +| Title | Type of change | Introduced version | +|----------------------------------------------------------------------------------------------------------------------------|---------------------|--------------------| +| [DefaultKeyResolution.ShouldGenerateNewKey has altered meaning](aspnet-core/9.0/key-resolution.md) | Behavioral change | Preview 3 | +| [Dev cert export no longer creates folder](aspnet-core/9.0/certificate-export.md) | Behavioral change | RC 1 | +| [HostBuilder enables ValidateOnBuild/ValidateScopes in development environment](aspnet-core/9.0/hostbuilder-validation.md) | Behavioral change | Preview 7 | +| [Legacy Mono and Emscripten APIs not exported to global namespace](aspnet-core/9.0/legacy-apis.md) | Source incompatible | GA | +| [Middleware types with multiple constructors](aspnet-core/9.0/middleware-constructors.md) | Behavioral change | RC 1 | ## Containers -| Title | Type of change | Introduced version | -|-----------------------------------------------------------------------------|-------------------|--------------------| -| [Container images no longer install zlib](containers/9.0/no-zlib.md) | Behavioral change | Preview 7 | -| [.NET Monitor images simplified to version-only tags](containers/9.0/monitor-images.md) | Behavioral change |Preview 5 | +| Title | Type of change | Introduced version | +|-----------------------------------------------------------------------------------------|-------------------|--------------------| +| [Container images no longer install zlib](containers/9.0/no-zlib.md) | Behavioral change | Preview 7 | +| [.NET Monitor images simplified to version-only tags](containers/9.0/monitor-images.md) | Behavioral change | Preview 5 | ## Core .NET libraries -| Title | Type of change | Introduced version | -|------------------------------------------------------------------------------------------|---------------------|--------------------| -| [Adding a ZipArchiveEntry with CompressionLevel sets ZIP central directory header general-purpose bit flags](core-libraries/9.0/compressionlevel-bits.md) | Behavioral change | Preview 5 | -| [Altered UnsafeAccessor support for non-open generics](core-libraries/9.0/unsafeaccessor-generics.md) | Behavioral change | Preview 6 | -| [API obsoletions with custom diagnostic IDs](core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md) | Source incompatible | (Multiple) | -| [BigInteger maximum length](core-libraries/9.0/biginteger-limit.md) | Behavioral change | Preview 6 | -| [BinaryReader.GetString() returns "\uFFFD" on malformed sequences](core-libraries/9.0/binaryreader.md) | Behavioral change | Preview 7 | -| [C# overload resolution prefers `params` span-type overloads](core-libraries/9.0/params-overloads.md) | Source incompatible | | -| [Creating type of array of System.Void not allowed](core-libraries/9.0/type-instance.md) | Behavioral change | Preview 1 | -| [Default `Equals()` and `GetHashCode()` throw for types marked with `InlineArrayAttribute`](core-libraries/9.0/inlinearrayattribute.md) | Behavioral change | Preview 6 | -| [EnumConverter validates registered types to be enum](core-libraries/9.0/enumconverter.md) | Behavioral change | Preview 7 | -| [FromKeyedServicesAttribute no longer injects non-keyed parameter](core-libraries/9.0/non-keyed-params.md) | Behavioral change | RC 1 | -| [IncrementingPollingCounter initial callback is asynchronous](core-libraries/9.0/async-callback.md) | Behavioral change | RC 1 | -| [Inline array struct size limit is enforced](core-libraries/9.0/inlinearray-size.md) | Behavioral change | Preview 1 | -| [InMemoryDirectoryInfo prepends rootDir to files](core-libraries/9.0/inmemorydirinfo-prepends-rootdir.md) | Behavioral change | Preview 1 | -| [New TimeSpan.From*() overloads that take integers](core-libraries/9.0/timespan-from-overloads.md) | Source incompatible | Preview 3 | -| [New version of some OOB packages](core-libraries/9.0/oob-packages.md) | Source incompatible | Preview 5 | -| [RuntimeHelpers.GetSubArray returns different type](core-libraries/9.0/getsubarray-return.md) | Behavioral change | Preview 1 | -| [String.Trim(params ReadOnlySpan\) overload removed](core-libraries/9.0/string-trim.md) | Source/binary incompatible | GA | -| [Support for empty environment variables](core-libraries/9.0/empty-env-variable.md) | Behavioral change | Preview 6 | -| [ZipArchiveEntry names and comments respect UTF8 flag](core-libraries/9.0/ziparchiveentry-encoding.md) | Behavioral change | RC 1 | +| Title | Type of change | Introduced version | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|--------------------| +| [Adding a ZipArchiveEntry with CompressionLevel sets ZIP central directory header general-purpose bit flags](core-libraries/9.0/compressionlevel-bits.md) | Behavioral change | Preview 5 | +| [Altered UnsafeAccessor support for non-open generics](core-libraries/9.0/unsafeaccessor-generics.md) | Behavioral change | Preview 6 | +| [API obsoletions with custom diagnostic IDs](core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md) | Source incompatible | (Multiple) | +| [Ambiguous overload resolution affecting StringValues implicit operators](core-libraries/9.0/ambiguous-overload.md) | Source incompatible | GA | +| [BigInteger maximum length](core-libraries/9.0/biginteger-limit.md) | Behavioral change | Preview 6 | +| [BinaryReader.GetString() returns "\uFFFD" on malformed sequences](core-libraries/9.0/binaryreader.md) | Behavioral change | Preview 7 | +| [C# overload resolution prefers `params` span-type overloads](core-libraries/9.0/params-overloads.md) | Source incompatible | | +| [Creating type of array of System.Void not allowed](core-libraries/9.0/type-instance.md) | Behavioral change | Preview 1 | +| [Default `Equals()` and `GetHashCode()` throw for types marked with `InlineArrayAttribute`](core-libraries/9.0/inlinearrayattribute.md) | Behavioral change | Preview 6 | +| [EnumConverter validates registered types to be enum](core-libraries/9.0/enumconverter.md) | Behavioral change | Preview 7 | +| [FromKeyedServicesAttribute no longer injects non-keyed parameter](core-libraries/9.0/non-keyed-params.md) | Behavioral change | RC 1 | +| [IncrementingPollingCounter initial callback is asynchronous](core-libraries/9.0/async-callback.md) | Behavioral change | RC 1 | +| [Inline array struct size limit is enforced](core-libraries/9.0/inlinearray-size.md) | Behavioral change | Preview 1 | +| [InMemoryDirectoryInfo prepends rootDir to files](core-libraries/9.0/inmemorydirinfo-prepends-rootdir.md) | Behavioral change | Preview 1 | +| [New TimeSpan.From*() overloads that take integers](core-libraries/9.0/timespan-from-overloads.md) | Source incompatible | Preview 3 | +| [New version of some OOB packages](core-libraries/9.0/oob-packages.md) | Source incompatible | Preview 5 | +| [RuntimeHelpers.GetSubArray returns different type](core-libraries/9.0/getsubarray-return.md) | Behavioral change | Preview 1 | +| [String.Trim(params ReadOnlySpan\) overload removed](core-libraries/9.0/string-trim.md) | Source/binary incompatible | GA | +| [Support for empty environment variables](core-libraries/9.0/empty-env-variable.md) | Behavioral change | Preview 6 | +| [ZipArchiveEntry names and comments respect UTF8 flag](core-libraries/9.0/ziparchiveentry-encoding.md) | Behavioral change | RC 1 | ## Cryptography -| Title | Type of change | Introduced version | -|-------|----------------|--------------------| -| [SafeEvpPKeyHandle.DuplicateHandle up-refs the handle](cryptography/9.0/evp-pkey-handle.md) | Behavioral change | Preview 7 | -| [Some X509Certificate2 and X509Certificate constructors are obsolete](cryptography/9.0/x509-certificates.md) | Source incompatible | Preview 7 | -| [Windows private key lifetime simplified](cryptography/9.0/private-key-lifetime.md) | Behavioral change | Preview 7 | +| Title | Type of change | Introduced version | +|--------------------------------------------------------------------------------------------------------------|---------------------|--------------------| +| [SafeEvpPKeyHandle.DuplicateHandle up-refs the handle](cryptography/9.0/evp-pkey-handle.md) | Behavioral change | Preview 7 | +| [Some X509Certificate2 and X509Certificate constructors are obsolete](cryptography/9.0/x509-certificates.md) | Source incompatible | Preview 7 | +| [Windows private key lifetime simplified](cryptography/9.0/private-key-lifetime.md) | Behavioral change | Preview 7 | ## Deployment -| Title | Type of change | Introduced version | -|-----------------------------------------------------------------------------------|---------------------|--------------------| -| [Deprecated desktop Windows/macOS/Linux MonoVM runtime packages](deployment/9.0/monovm-packages.md) | Source incompatible | Preview 7 | +| Title | Type of change | Introduced version | +|-----------------------------------------------------------------------------------------------------|---------------------|--------------------| +| [Deprecated desktop Windows/macOS/Linux MonoVM runtime packages](deployment/9.0/monovm-packages.md) | Source incompatible | Preview 7 | ## Interop @@ -85,30 +86,30 @@ If you're migrating an app to .NET 9, the breaking changes listed here might aff ## Networking -| Title | Type of change | Introduced version | -|-----------------------------------------------------------------------------------|---------------------|--------------------| -| [API obsoletions](core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md) | Source incompatible | Preview 6 | -| [HttpClient metrics report `server.port` unconditionally](networking/9.0/server-port-attribute.md) | Behavioral change | Preview 7 | -| [HttpClientFactory logging redacts header values by default](networking/9.0/redact-headers.md) | Behavioral change | RC 1 | -| [HttpClientFactory uses SocketsHttpHandler as primary handler](networking/9.0/default-handler.md) | Behavioral change | Preview 6 | -| [HttpListenerRequest.UserAgent is nullable](networking/9.0/useragent-nullable.md) | Source incompatible | Preview 1 | -| [URI query redaction in HttpClient EventSource events](networking/9.0/query-redaction-events.md) | Behavioral change | Preview 7 | -| [URI query redaction in IHttpClientFactory logs](networking/9.0/query-redaction-logs.md) | Behavioral change | Preview 7 | +| Title | Type of change | Introduced version | +|----------------------------------------------------------------------------------------------------|---------------------|--------------------| +| [API obsoletions](core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md) | Source incompatible | Preview 6 | +| [HttpClient metrics report `server.port` unconditionally](networking/9.0/server-port-attribute.md) | Behavioral change | Preview 7 | +| [HttpClientFactory logging redacts header values by default](networking/9.0/redact-headers.md) | Behavioral change | RC 1 | +| [HttpClientFactory uses SocketsHttpHandler as primary handler](networking/9.0/default-handler.md) | Behavioral change | Preview 6 | +| [HttpListenerRequest.UserAgent is nullable](networking/9.0/useragent-nullable.md) | Source incompatible | Preview 1 | +| [URI query redaction in HttpClient EventSource events](networking/9.0/query-redaction-events.md) | Behavioral change | Preview 7 | +| [URI query redaction in IHttpClientFactory logs](networking/9.0/query-redaction-logs.md) | Behavioral change | Preview 7 | ## SDK and MSBuild -| Title | Type of change | Introduced version | -|-------------------------------------------------------------------------------|-------------------|--------------------| -| [`dotnet restore` audits transitive packages](sdk/9.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 6 | -| [`dotnet sln add` doesn't allow invalid file names](sdk/9.0/dotnet-sln.md) | Behavioral change | 9.0.2xx | -| [`dotnet watch` incompatible with Hot Reload for old frameworks](sdk/9.0/dotnet-watch.md) | Behavioral change | RC 1 | -| [`dotnet workload` commands output change](sdk/9.0/dotnet-workload-output.md) | Behavioral change | Preview 1 | -| [`installer` repo version no longer documented](sdk/9.0/productcommits-versions.md) | Behavioral change | Preview 5 | -| [New default RID used when targeting .NET Framework](sdk/9.0/default-rid.md) | Source incompatible | GA | -| [Terminal logger is default](sdk/9.0/terminal-logger.md) | Behavioral change | Preview 1 | -| [Version requirements for .NET 9 SDK](sdk/9.0/version-requirements.md) | Source incompatible | GA | -| [Warning emitted for .NET Standard 1.x target](sdk/9.0/netstandard-warning.md) | Source incompatible | Preview 6 | -| [Warning emitted for .NET 7 target](sdk/9.0/net70-warning.md) | Source incompatible | GA | +| Title | Type of change | Introduced version | +|-------------------------------------------------------------------------------------------|---------------------|--------------------| +| [`dotnet restore` audits transitive packages](sdk/9.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 6 | +| [`dotnet sln add` doesn't allow invalid file names](sdk/9.0/dotnet-sln.md) | Behavioral change | 9.0.2xx | +| [`dotnet watch` incompatible with Hot Reload for old frameworks](sdk/9.0/dotnet-watch.md) | Behavioral change | RC 1 | +| [`dotnet workload` commands output change](sdk/9.0/dotnet-workload-output.md) | Behavioral change | Preview 1 | +| [`installer` repo version no longer documented](sdk/9.0/productcommits-versions.md) | Behavioral change | Preview 5 | +| [New default RID used when targeting .NET Framework](sdk/9.0/default-rid.md) | Source incompatible | GA | +| [Terminal logger is default](sdk/9.0/terminal-logger.md) | Behavioral change | Preview 1 | +| [Version requirements for .NET 9 SDK](sdk/9.0/version-requirements.md) | Source incompatible | GA | +| [Warning emitted for .NET Standard 1.x target](sdk/9.0/netstandard-warning.md) | Source incompatible | Preview 6 | +| [Warning emitted for .NET 7 target](sdk/9.0/net70-warning.md) | Source incompatible | GA | ## Serialization diff --git a/docs/core/compatibility/core-libraries/9.0/ambiguous-overload.md b/docs/core/compatibility/core-libraries/9.0/ambiguous-overload.md new file mode 100644 index 0000000000000..173013a6403e6 --- /dev/null +++ b/docs/core/compatibility/core-libraries/9.0/ambiguous-overload.md @@ -0,0 +1,48 @@ +--- +title: "Breaking change: Ambiguous overload resolution affecting StringValues implicit operators" +description: Learn about the .NET 9 breaking change in core .NET libraries where ambiguous overload resolution now throws error CS0121. +ms.date: 02/24/2025 +ai-usage: ai-assisted +--- + +# Ambiguous overload resolution affecting StringValues implicit operators + +In .NET 9, a breaking change in the [`params Span` lang feature](../../../whats-new/dotnet-9/libraries.md#params-readonlyspant-overloads) creates ambiguity with the implicit operators of . This change results in the compiler throwing error `CS0121` when it encounters ambiguous method calls. + +## Previous behavior + +The APIs mentioned in the [Affected APIs](#affected-apis) section previously had no overloads ambiguous with the implicit operators of . As a result, the compiler would resolve the overloads without any issues. + +## New behavior + +The compiler throws error `CS0121` when encountering these ambiguous overloads, resulting in the following error: + +```output +CS0121: The call is ambiguous between the following methods or properties: 'Program.Join(string, params string[])' and 'Program.Join(string, params ReadOnlySpan)' +``` + +## Version introduced + +.NET 9 + +## Type of breaking change + +This change is a [source compatibility](../../categories.md#source-compatibility) change. + +## Reason for change + + has implicit operators for `string` and `string[]` that cause conflicts with the [`params Span` lang feature](../../../whats-new/dotnet-9/libraries.md#params-readonlyspant-overloads). + +## Recommended action + +Explicitly specify the method you intend to call by casting the arguments to the appropriate type or apply named parameters. + +## Affected APIs + +- +- +- +- +- +- +- diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index c4d2fbaf6ca1d..3193f1ec4861b 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -74,6 +74,8 @@ items: href: core-libraries/9.0/compressionlevel-bits.md - name: Altered UnsafeAccessor support for non-open generics href: core-libraries/9.0/unsafeaccessor-generics.md + - name: Ambiguous overload resolution affecting StringValues implicit operators + href: core-libraries/9.0/ambiguous-overload.md - name: API obsoletions with custom diagnostic IDs href: core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md - name: BigInteger maximum length @@ -1366,6 +1368,8 @@ items: href: core-libraries/9.0/compressionlevel-bits.md - name: Altered UnsafeAccessor support for non-open generics href: core-libraries/9.0/unsafeaccessor-generics.md + - name: Ambiguous overload resolution affecting StringValues implicit operators + href: core-libraries/9.0/ambiguous-overload.md - name: API obsoletions with custom diagnostic IDs href: core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md - name: BigInteger maximum length