Skip to content

Commit dc5a0ed

Browse files
Merge pull request #45057 from dotnet/main
Merge main into live
2 parents 95ddd7e + 2a36a37 commit dc5a0ed

File tree

11 files changed

+190
-90
lines changed

11 files changed

+190
-90
lines changed

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ jobs:
6363
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6464
# format to the repository Actions tab.
6565
- name: "Upload artifact"
66-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
66+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
6767
with:
6868
name: SARIF file
6969
path: results.sarif
7070
retention-days: 5
7171

7272
# Upload the results to GitHub's code scanning dashboard.
7373
- name: "Upload to code-scanning"
74-
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
74+
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
7575
with:
7676
sarif_file: results.sarif

docs/core/compatibility/9.0.md

Lines changed: 62 additions & 61 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "Breaking change: Ambiguous overload resolution affecting StringValues implicit operators"
3+
description: Learn about the .NET 9 breaking change in core .NET libraries where ambiguous overload resolution now throws error CS0121.
4+
ms.date: 02/24/2025
5+
ai-usage: ai-assisted
6+
---
7+
8+
# Ambiguous overload resolution affecting StringValues implicit operators
9+
10+
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.
11+
12+
## Previous behavior
13+
14+
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.
15+
16+
## New behavior
17+
18+
The compiler throws error `CS0121` when encountering these ambiguous overloads, resulting in the following error:
19+
20+
```output
21+
CS0121: The call is ambiguous between the following methods or properties: 'Program.Join(string, params string[])' and 'Program.Join(string, params ReadOnlySpan<string>)'
22+
```
23+
24+
## Version introduced
25+
26+
.NET 9
27+
28+
## Type of breaking change
29+
30+
This change is a [source compatibility](../../categories.md#source-compatibility) change.
31+
32+
## Reason for change
33+
34+
<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).
35+
36+
## Recommended action
37+
38+
Explicitly specify the method you intend to call by casting the arguments to the appropriate type or apply named parameters.
39+
40+
## Affected APIs
41+
42+
- <xref:System.String.Concat(System.ReadOnlySpan{System.String})?displayProperty=fullName>
43+
- <xref:System.String.Join(System.Char,System.ReadOnlySpan{System.String})?displayProperty=fullName>
44+
- <xref:System.String.Join(System.String,System.ReadOnlySpan{System.String})?displayProperty=fullName>
45+
- <xref:System.IO.Path.Combine(System.ReadOnlySpan{System.String})?displayProperty=fullName>
46+
- <xref:System.IO.Path.Join(System.ReadOnlySpan{System.String})?displayProperty=fullName>
47+
- <xref:System.Text.StringBuilder.AppendJoin(System.String,System.ReadOnlySpan{System.String})?displayProperty=fullName>
48+
- <xref:System.Text.StringBuilder.AppendJoin(System.Char,System.ReadOnlySpan{System.Object})?displayProperty=fullName>

docs/core/compatibility/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ items:
7474
href: core-libraries/9.0/compressionlevel-bits.md
7575
- name: Altered UnsafeAccessor support for non-open generics
7676
href: core-libraries/9.0/unsafeaccessor-generics.md
77+
- name: Ambiguous overload resolution affecting StringValues implicit operators
78+
href: core-libraries/9.0/ambiguous-overload.md
7779
- name: API obsoletions with custom diagnostic IDs
7880
href: core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md
7981
- name: BigInteger maximum length
@@ -1366,6 +1368,8 @@ items:
13661368
href: core-libraries/9.0/compressionlevel-bits.md
13671369
- name: Altered UnsafeAccessor support for non-open generics
13681370
href: core-libraries/9.0/unsafeaccessor-generics.md
1371+
- name: Ambiguous overload resolution affecting StringValues implicit operators
1372+
href: core-libraries/9.0/ambiguous-overload.md
13691373
- name: API obsoletions with custom diagnostic IDs
13701374
href: core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md
13711375
- name: BigInteger maximum length

docs/core/install/linux.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ This article describes how .NET is available on various Linux distributions. .NE
1919

2020
## Packages
2121

22-
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:
22+
Packages are available for the following Linux distributions:
2323

24-
- Azure Linux 3.0
24+
- Azure Linux
2525
- [Debian](linux-debian.md)
2626
- [openSUSE Leap](linux-opensuse.md)
2727
- [SUSE Enterprise Linux](linux-sles.md)
2828

29-
The following Linux distributions officially support .NET, and publish their own .NET packages:
29+
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).
30+
31+
The following Linux distributions publish their own .NET packages:
3032

31-
- Azure Linux 2.0 (CBL-Mariner)
3233
- [Alpine](linux-alpine.md)
3334
- [CentOS Stream](linux-rhel.md#centos-stream-9)
3435
- [Fedora](linux-fedora.md)

docs/core/tools/dotnet-sln.md

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: dotnet sln command
33
description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file.
4-
ms.date: 05/18/2022
4+
ms.date: 02/24/2025
55
---
66
# dotnet sln
77

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

1010
## Name
1111

12-
`dotnet sln` - Lists or modifies the projects in a .NET solution file.
12+
`dotnet sln` - Lists or modifies the projects in a .NET solution file, or migrates the file to an *.slnx* file.
1313

1414
## Synopsis
1515

@@ -49,14 +49,23 @@ dotnet new sln --output MySolution
4949

5050
- **`SOLUTION_FILE`**
5151

52-
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.
52+
The solution file to use (either an *.sln* or *.slnx* file).
53+
54+
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.
5355

5456
## Options
5557

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

5860
## Commands
5961

62+
The following commands are available:
63+
64+
- [`list`](#list)
65+
- [`add`](#add)
66+
- [`remove`](#remove)
67+
- [`migrate`](#migrate)
68+
6069
### `list`
6170

6271
Lists all projects in a solution file.
@@ -71,7 +80,9 @@ dotnet sln list [-h|--help]
7180

7281
- **`SOLUTION_FILE`**
7382

74-
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.
83+
The solution file to use (either an *.sln* or *.slnx* file).
84+
85+
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.
7586

7687
#### Options
7788

@@ -92,7 +103,9 @@ dotnet sln add [-h|--help]
92103

93104
- **`SOLUTION_FILE`**
94105

95-
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.
106+
The solution file to use (either an *.sln* or *.slnx* file).
107+
108+
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.
96109

97110
- **`PROJECT_PATH`**
98111

@@ -135,7 +148,9 @@ dotnet sln [<SOLUTION_FILE>] remove [-h|--help]
135148

136149
- **`SOLUTION_FILE`**
137150

138-
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.
151+
The solution file to use (either an *.sln* or *.slnx* file).
152+
153+
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.
139154

140155
- **`PROJECT_PATH`**
141156

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

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

163+
### `migrate`
164+
165+
Generates an *.slnx* solution file from an *.sln* file.
166+
167+
#### Synopsis
168+
169+
```dotnetcli
170+
dotnet sln [<SOLUTION_FILE>] migrate
171+
dotnet sln [<SOLUTION_FILE>] migrate [-h|--help]
172+
```
173+
174+
#### Arguments
175+
176+
- **`SOLUTION_FILE`**
177+
178+
The *.sln* solution file to migrate.
179+
180+
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.
181+
182+
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.
183+
184+
#### Options
185+
186+
[!INCLUDE [help](../../../includes/cli-help.md)]
187+
148188
## Examples
149189

150190
- List the projects in a solution:
151191

152192
```dotnetcli
153-
dotnet sln todo.sln list
193+
dotnet sln todo.slnx list
154194
```
155195

156196
- Add a C# project to a solution:
@@ -168,43 +208,49 @@ dotnet sln [<SOLUTION_FILE>] remove [-h|--help]
168208
- Add multiple C# projects to the root of a solution:
169209

170210
```dotnetcli
171-
dotnet sln todo.sln add todo-app/todo-app.csproj back-end/back-end.csproj --in-root
211+
dotnet sln todo.slnx add todo-app/todo-app.csproj back-end/back-end.csproj --in-root
172212
```
173213

174214
- Add multiple C# projects to a solution:
175215

176216
```dotnetcli
177-
dotnet sln todo.sln add todo-app/todo-app.csproj back-end/back-end.csproj
217+
dotnet sln todo.slnx add todo-app/todo-app.csproj back-end/back-end.csproj
178218
```
179219

180220
- Remove multiple C# projects from a solution:
181221

182222
```dotnetcli
183-
dotnet sln todo.sln remove todo-app/todo-app.csproj back-end/back-end.csproj
223+
dotnet sln todo.slnx remove todo-app/todo-app.csproj back-end/back-end.csproj
184224
```
185225

186226
- Add multiple C# projects to a solution using a globbing pattern (Unix/Linux only):
187227

188228
```dotnetcli
189-
dotnet sln todo.sln add **/*.csproj
229+
dotnet sln todo.slnx add **/*.csproj
190230
```
191231

192232
- Add multiple C# projects to a solution using a globbing pattern (Windows PowerShell only):
193233

194234
```dotnetcli
195-
dotnet sln todo.sln add (ls -r **/*.csproj)
235+
dotnet sln todo.slnx add (ls -r **/*.csproj)
196236
```
197237

198238
- Remove multiple C# projects from a solution using a globbing pattern (Unix/Linux only):
199239

200240
```dotnetcli
201-
dotnet sln todo.sln remove **/*.csproj
241+
dotnet sln todo.slnx remove **/*.csproj
202242
```
203243

204244
- Remove multiple C# projects from a solution using a globbing pattern (Windows PowerShell only):
205245

206246
```dotnetcli
207-
dotnet sln todo.sln remove (ls -r **/*.csproj)
247+
dotnet sln todo.slnx remove (ls -r **/*.csproj)
248+
```
249+
250+
- Generate an *.slnx* file from a *.sln* file:
251+
252+
```dotnetcli
253+
dotnet sln todo.sln migrate
208254
```
209255

210256
- 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 [<SOLUTION_FILE>] remove [-h|--help]
214260
dotnet new console -o myapp
215261
dotnet new classlib -o mylib1
216262
dotnet new classlib -o mylib2
217-
dotnet sln mysolution.sln add myapp\myapp.csproj
218-
dotnet sln mysolution.sln add mylib1\mylib1.csproj --solution-folder mylibs
219-
dotnet sln mysolution.sln add mylib2\mylib2.csproj --solution-folder mylibs
263+
dotnet sln mysolution.slnx add myapp\myapp.csproj
264+
dotnet sln mysolution.slnx add mylib1\mylib1.csproj --solution-folder mylibs
265+
dotnet sln mysolution.slnx add mylib2\mylib2.csproj --solution-folder mylibs
220266
```
221267

222268
The following screenshot shows the result in Visual Studio 2019 **Solution Explorer**:

docs/core/tools/dotnet-test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Some examples of the `dotnet.config` file:
1717

1818
```toml
1919
[dotnet.test:runner]
20-
name = "MicrosoftTestingPlatform"
20+
name = "Microsoft.Testing.Platform"
2121
```
2222

2323
```toml

docs/core/whats-new/dotnet-10/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ai-usage: ai-assisted
1111

1212
Learn about the new features in .NET 10 and find links to further documentation. This page has been updated for Preview 1.
1313

14-
.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).
14+
.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).
1515

1616
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).
1717

@@ -43,7 +43,7 @@ For more information, see [What's new in the SDK for .NET 10](sdk.md).
4343

4444
.NET Aspire releases version 9.1, which focuses on quality-of-life fixes.
4545

46-
For more information, see [.NET Aspire — what's new?](/dotnet/aspire/whats-new/).
46+
For more information, see [What's new in .NET Aspire 9.1](/dotnet/aspire/whats-new/dotnet-aspire-9.1).
4747

4848
## ASP.NET Core
4949

docs/csharp/whats-new/csharp-14.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private string _msg;
3434
public string Message
3535
{
3636
get => _msg;
37-
set => _msg = value ?? throw new NullArgumentException(nameof(value));
37+
set => _msg = value ?? throw new ArgumentNullException(nameof(value));
3838
}
3939
```
4040

samples/snippets/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
10+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0" />
1111
</ItemGroup>
1212

1313
</Project>

0 commit comments

Comments
 (0)