Skip to content

Commit b191e1e

Browse files
authored
Add breaking change documentation for dotnet new sln defaulting to SLNX format (#48195)
1 parent 6b7617a commit b191e1e

File tree

4 files changed

+75
-4
lines changed

4 files changed

+75
-4
lines changed

docs/core/compatibility/10.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
105105
| [.NET CLI `--interactive` defaults to `true` in user scenarios](sdk/10.0/dotnet-cli-interactive.md) | Behavioral change | Preview 3 |
106106
| [.NET tool packaging creates RuntimeIdentifier-specific tool packages](sdk/10.0/dotnet-tool-pack-publish.md) | Behavioral change | Preview 6 |
107107
| [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 |
108+
| [`dotnet new sln` defaults to SLNX file format](sdk/10.0/dotnet-new-sln-slnx-default.md) | Behavioral change | RC 1 |
108109
| [`dotnet package list` performs restore](sdk/10.0/dotnet-package-list-restore.md) | Behavioral change | Preview 4 |
109110
| [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 3 |
110111
| [project.json not supported in `dotnet restore`](sdk/10.0/dotnet-restore-project-json-unsupported.md) | Source incompatible | Preview 7 |
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: "Breaking change - `dotnet new sln` defaults to SLNX file format"
3+
description: "Learn about the breaking change in .NET 10 where `dotnet new sln` creates SLNX-format solution files instead of SLN-format files."
4+
ms.date: 08/30/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/48192
7+
---
8+
9+
# `dotnet new sln` defaults to SLNX file format
10+
11+
In .NET 10, `dotnet new sln` generates an [SLNX-format](https://devblogs.microsoft.com/visualstudio/new-simpler-solution-file-format/) solution file instead of an SLN-formatted solution file.
12+
13+
## Version introduced
14+
15+
.NET 10 RC 1
16+
17+
## Previous behavior
18+
19+
Previously, `dotnet new sln` created a SLN-format solution file similar to:
20+
21+
```sln
22+
# Visual Studio Version 17
23+
VisualStudioVersion = 17.0.31903.59
24+
MinimumVisualStudioVersion = 10.0.40219.1
25+
Global
26+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
27+
Debug|Any CPU = Debug|Any CPU
28+
Release|Any CPU = Release|Any CPU
29+
EndGlobalSection
30+
GlobalSection(SolutionProperties) = preSolution
31+
HideSolutionNode = FALSE
32+
EndGlobalSection
33+
EndGlobal
34+
```
35+
36+
## New behavior
37+
38+
Starting in .NET 10, `dotnet new sln` creates a SLNX-format solution file similar to:
39+
40+
```xml
41+
<Solution>
42+
</Solution>
43+
```
44+
45+
## Type of breaking change
46+
47+
This change is a [behavioral change](../../categories.md#behavioral-change).
48+
49+
## Reason for change
50+
51+
The .NET SDK [added support for SLNX files](https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/) in version 9.0.200, and it's proven to be a stable, understandable format for developers. It's well-supported by all major .NET tooling and is much easier for developers to maintain. This breaking change aims to encourage the use of the SLNX format.
52+
53+
## Recommended action
54+
55+
If you desire an SLN-formatted solution file, pass the `--format sln` option to the command:
56+
57+
`dotnet new sln --format sln`
58+
59+
## Affected APIs
60+
61+
None.
62+
63+
## See also
64+
65+
- [.NET default templates for dotnet new](../../../tools/dotnet-new-sdk-templates.md)

docs/core/compatibility/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ items:
118118
href: sdk/10.0/dotnet-restore-project-json-unsupported.md
119119
- name: Default workload configuration from 'loose manifests' to 'workload sets' mode
120120
href: sdk/10.0/default-workload-config.md
121+
- name: "`dotnet new sln` defaults to SLNX file format"
122+
href: sdk/10.0/dotnet-new-sln-slnx-default.md
121123
- name: "`dotnet package list` performs restore"
122124
href: sdk/10.0/dotnet-package-list-restore.md
123125
- name: MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed

docs/core/tools/dotnet-sln.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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: 03/26/2025
4+
ms.date: 08/29/2025
55
---
66
# dotnet sln
77

@@ -27,24 +27,27 @@ The `dotnet sln` command provides a convenient way to list and modify projects i
2727

2828
To use the `dotnet sln` command, the solution file must already exist. If you need to create one, use the [dotnet new](dotnet-new.md) command with the `sln` template name.
2929

30-
The following example creates a *.sln* file in the current folder, with the same name as the folder:
30+
The following example creates an *.slnx* file in the current folder, with the same name as the folder:
3131

3232
```dotnetcli
3333
dotnet new sln
3434
```
3535

36-
The following example creates a *.sln* file in the current folder, with the specified file name:
36+
The following example creates an *.slnx* file in the current folder, with the specified file name:
3737

3838
```dotnetcli
3939
dotnet new sln --name MySolution
4040
```
4141

42-
The following example creates a *.sln* file in the specified folder, with the same name as the folder:
42+
The following example creates an *.slnx* file in the specified folder, with the same name as the folder:
4343

4444
```dotnetcli
4545
dotnet new sln --output MySolution
4646
```
4747

48+
> [!NOTE]
49+
> In .NET 9 and earlier versions, `dotnet new sln` creates an *.sln* file instead of an *.slnx* file.
50+
4851
## Arguments
4952

5053
- **`SOLUTION_FILE`**

0 commit comments

Comments
 (0)