From d0c3b18864aa331296d9ccf1503eed8ef05bc5ff Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 30 Aug 2025 00:18:11 +0000 Subject: [PATCH 1/3] Initial plan From 3ab9198cf0003c99e98324f7afba812e398d88a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 30 Aug 2025 00:24:51 +0000 Subject: [PATCH 2/3] Add breaking change documentation for dotnet new sln defaulting to SLNX format Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/core/compatibility/10.0.md | 1 + .../sdk/10.0/dotnet-new-sln-slnx-default.md | 59 +++++++++++++++++++ docs/core/compatibility/toc.yml | 2 + 3 files changed, 62 insertions(+) create mode 100644 docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index fc4ed826430ea..971c193e7ea29 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -105,6 +105,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | [.NET CLI `--interactive` defaults to `true` in user scenarios](sdk/10.0/dotnet-cli-interactive.md) | Behavioral change | Preview 3 | | [.NET tool packaging creates RuntimeIdentifier-specific tool packages](sdk/10.0/dotnet-tool-pack-publish.md) | Behavioral change | Preview 6 | | [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 | +| [`dotnet new sln` defaults to SLNX file format](sdk/10.0/dotnet-new-sln-slnx-default.md) | Behavioral change | RC 1 | | [`dotnet package list` performs restore](sdk/10.0/dotnet-package-list-restore.md) | Behavioral change | Preview 4 | | [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 3 | | [project.json not supported in `dotnet restore`](sdk/10.0/dotnet-restore-project-json-unsupported.md) | Source incompatible | Preview 7 | diff --git a/docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md b/docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md new file mode 100644 index 0000000000000..14b439734dc2c --- /dev/null +++ b/docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md @@ -0,0 +1,59 @@ +--- +title: "Breaking change - `dotnet new sln` defaults to SLNX file format" +description: "Learn about the breaking change in .NET 10 where dotnet new sln creates SLNX-format solution files instead of SLN-format files." +ms.date: 08/30/2025 +ai-usage: ai-assisted +ms.custom: https://github.com/dotnet/docs/issues/48192 +--- + +# `dotnet new sln` defaults to SLNX file format + +In .NET 10, `dotnet new sln` generates a [SLNX-format](https://devblogs.microsoft.com/visualstudio/new-simpler-solution-file-format/) solution file instead of a SLN-formatted solution file. + +## Version introduced + +.NET 10 RC 1 + +## Previous behavior + +`dotnet new sln` created a SLN-format solution file similar to: + +```sln +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal +``` + +## New behavior + +`dotnet new sln` creates a SLNX-format solution file similar to: + +```xml + + +``` + +## Type of breaking change + +This is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +Support for SLNX was [added in 9.0.200](https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/), 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. We want to encourage the usage of the format to make everyone's lives simpler. + +## Recommended action + +If a SLN-formatted solution is needed, use `dotnet new sln --format sln` to get a SLN-formatted solution file. + +## Affected APIs + +None. \ No newline at end of file diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 4a81877a15947..9a56a8726e7a3 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -118,6 +118,8 @@ items: href: sdk/10.0/dotnet-restore-project-json-unsupported.md - name: Default workload configuration from 'loose manifests' to 'workload sets' mode href: sdk/10.0/default-workload-config.md + - name: "`dotnet new sln` defaults to SLNX file format" + href: sdk/10.0/dotnet-new-sln-slnx-default.md - name: "`dotnet package list` performs restore" href: sdk/10.0/dotnet-package-list-restore.md - name: MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed From 94922a66b31af3d426bee2326c84d21f0d3b3af1 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 29 Aug 2025 19:13:50 -0700 Subject: [PATCH 3/3] human edits --- .../sdk/10.0/dotnet-new-sln-slnx-default.md | 22 ++++++++++++------- docs/core/tools/dotnet-sln.md | 11 ++++++---- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md b/docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md index 14b439734dc2c..4c813a700b558 100644 --- a/docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md +++ b/docs/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default.md @@ -1,6 +1,6 @@ --- title: "Breaking change - `dotnet new sln` defaults to SLNX file format" -description: "Learn about the breaking change in .NET 10 where dotnet new sln creates SLNX-format solution files instead of SLN-format files." +description: "Learn about the breaking change in .NET 10 where `dotnet new sln` creates SLNX-format solution files instead of SLN-format files." ms.date: 08/30/2025 ai-usage: ai-assisted ms.custom: https://github.com/dotnet/docs/issues/48192 @@ -8,7 +8,7 @@ ms.custom: https://github.com/dotnet/docs/issues/48192 # `dotnet new sln` defaults to SLNX file format -In .NET 10, `dotnet new sln` generates a [SLNX-format](https://devblogs.microsoft.com/visualstudio/new-simpler-solution-file-format/) solution file instead of a SLN-formatted solution file. +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. ## Version introduced @@ -16,7 +16,7 @@ In .NET 10, `dotnet new sln` generates a [SLNX-format](https://devblogs.microsof ## Previous behavior -`dotnet new sln` created a SLN-format solution file similar to: +Previously, `dotnet new sln` created a SLN-format solution file similar to: ```sln # Visual Studio Version 17 @@ -35,7 +35,7 @@ EndGlobal ## New behavior -`dotnet new sln` creates a SLNX-format solution file similar to: +Starting in .NET 10, `dotnet new sln` creates a SLNX-format solution file similar to: ```xml @@ -44,16 +44,22 @@ EndGlobal ## Type of breaking change -This is a [behavioral change](../../categories.md#behavioral-change). +This change is a [behavioral change](../../categories.md#behavioral-change). ## Reason for change -Support for SLNX was [added in 9.0.200](https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/), 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. We want to encourage the usage of the format to make everyone's lives simpler. +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. ## Recommended action -If a SLN-formatted solution is needed, use `dotnet new sln --format sln` to get a SLN-formatted solution file. +If you desire an SLN-formatted solution file, pass the `--format sln` option to the command: + +`dotnet new sln --format sln` ## Affected APIs -None. \ No newline at end of file +None. + +## See also + +- [.NET default templates for dotnet new](../../../tools/dotnet-new-sdk-templates.md) diff --git a/docs/core/tools/dotnet-sln.md b/docs/core/tools/dotnet-sln.md index 098939ca8264e..4c392953e883d 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: 03/26/2025 +ms.date: 08/29/2025 --- # dotnet sln @@ -27,24 +27,27 @@ The `dotnet sln` command provides a convenient way to list and modify projects i 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. -The following example creates a *.sln* file in the current folder, with the same name as the folder: +The following example creates an *.slnx* file in the current folder, with the same name as the folder: ```dotnetcli dotnet new sln ``` -The following example creates a *.sln* file in the current folder, with the specified file name: +The following example creates an *.slnx* file in the current folder, with the specified file name: ```dotnetcli dotnet new sln --name MySolution ``` -The following example creates a *.sln* file in the specified folder, with the same name as the folder: +The following example creates an *.slnx* file in the specified folder, with the same name as the folder: ```dotnetcli dotnet new sln --output MySolution ``` +> [!NOTE] +> In .NET 9 and earlier versions, `dotnet new sln` creates an *.sln* file instead of an *.slnx* file. + ## Arguments - **`SOLUTION_FILE`**