Skip to content
Merged
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ 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
retention-days: 5

# 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
123 changes: 62 additions & 61 deletions docs/core/compatibility/9.0.md

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions docs/core/compatibility/core-libraries/9.0/ambiguous-overload.md
Original file line number Diff line number Diff line change
@@ -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<T>` lang feature](../../../whats-new/dotnet-9/libraries.md#params-readonlyspant-overloads) creates ambiguity with the implicit operators of <xref:Microsoft.Extensions.Primitives.StringValues>. 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 <xref:Microsoft.Extensions.Primitives.StringValues>. 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<string>)'
```

## Version introduced

.NET 9

## Type of breaking change

This change is a [source compatibility](../../categories.md#source-compatibility) change.

## Reason for change

<xref:Microsoft.Extensions.Primitives.StringValues> has implicit operators for `string` and `string[]` that cause conflicts with the [`params Span<T>` 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

- <xref:System.String.Concat(System.ReadOnlySpan{System.String})?displayProperty=fullName>
- <xref:System.String.Join(System.Char,System.ReadOnlySpan{System.String})?displayProperty=fullName>
- <xref:System.String.Join(System.String,System.ReadOnlySpan{System.String})?displayProperty=fullName>
- <xref:System.IO.Path.Combine(System.ReadOnlySpan{System.String})?displayProperty=fullName>
- <xref:System.IO.Path.Join(System.ReadOnlySpan{System.String})?displayProperty=fullName>
- <xref:System.Text.StringBuilder.AppendJoin(System.String,System.ReadOnlySpan{System.String})?displayProperty=fullName>
- <xref:System.Text.StringBuilder.AppendJoin(System.Char,System.ReadOnlySpan{System.Object})?displayProperty=fullName>
4 changes: 4 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions docs/core/install/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://packages.microsoft.com/>. 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 <https://packages.microsoft.com/>. 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)
Expand Down
80 changes: 63 additions & 17 deletions docs/core/tools/dotnet-sln.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
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

**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions

## 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

Expand Down Expand Up @@ -49,14 +49,23 @@ 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

[!INCLUDE [help](../../../includes/cli-help.md)]

## Commands

The following commands are available:

- [`list`](#list)
- [`add`](#add)
- [`remove`](#remove)
- [`migrate`](#migrate)

### `list`

Lists all projects in a solution file.
Expand All @@ -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

Expand All @@ -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`**

Expand Down Expand Up @@ -135,7 +148,9 @@ dotnet sln [<SOLUTION_FILE>] 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`**

Expand All @@ -145,12 +160,37 @@ dotnet sln [<SOLUTION_FILE>] remove [-h|--help]

[!INCLUDE [help](../../../includes/cli-help.md)]

### `migrate`

Generates an *.slnx* solution file from an *.sln* file.

#### Synopsis

```dotnetcli
dotnet sln [<SOLUTION_FILE>] migrate
dotnet sln [<SOLUTION_FILE>] 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:
Expand All @@ -168,43 +208,49 @@ dotnet sln [<SOLUTION_FILE>] 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.
Expand All @@ -214,9 +260,9 @@ dotnet sln [<SOLUTION_FILE>] 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**:
Expand Down
2 changes: 1 addition & 1 deletion docs/core/tools/dotnet-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Some examples of the `dotnet.config` file:

```toml
[dotnet.test:runner]
name = "MicrosoftTestingPlatform"
name = "Microsoft.Testing.Platform"
```

```toml
Expand Down
4 changes: 2 additions & 2 deletions docs/core/whats-new/dotnet-10/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/whats-new/csharp-14.md
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0" />
</ItemGroup>

</Project>
Loading