From fb21faeac4c7f26b79eeb7ba2388dcfbb821c0dc Mon Sep 17 00:00:00 2001
From: "costellobot[bot]" <102247573+costellobot[bot]@users.noreply.github.com>
Date: Sun, 6 Apr 2025 12:21:58 +0000
Subject: [PATCH 1/2] Migrate solution to SLNX
Migrates the .NET solution to use the new [`.slnx`][slnx] file format.
[slnx]: https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/
Contributes to https://github.com/martincostello/repo-migrations/issues/85.
Signed-off-by: costellobot[bot] <102247573+costellobot[bot]@users.noreply.github.com>
---
TodoApp.sln | 104 ---------------------------------------------------
TodoApp.slnx | 53 ++++++++++++++++++++++++++
2 files changed, 53 insertions(+), 104 deletions(-)
delete mode 100644 TodoApp.sln
create mode 100644 TodoApp.slnx
diff --git a/TodoApp.sln b/TodoApp.sln
deleted file mode 100644
index 0b7dd170..00000000
--- a/TodoApp.sln
+++ /dev/null
@@ -1,104 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.31410.414
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{6326B5D0-9981-4488-B46F-9879F825965D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FB647623-961E-4B9C-91F4-E94664F7BEEF}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{813B2DEF-0737-4242-8AB4-CF0725752CD0}"
- ProjectSection(SolutionItems) = preProject
- .editorconfig = .editorconfig
- .gitattributes = .gitattributes
- .gitignore = .gitignore
- .markdownlint.json = .markdownlint.json
- .vsconfig = .vsconfig
- build.ps1 = build.ps1
- CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
- Directory.Build.props = Directory.Build.props
- global.json = global.json
- LICENSE = LICENSE
- NuGet.config = NuGet.config
- omnisharp.json = omnisharp.json
- README.md = README.md
- SECURITY.md = SECURITY.md
- startvs.cmd = startvs.cmd
- startvscode.cmd = startvscode.cmd
- TodoApp.ruleset = TodoApp.ruleset
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TodoApp", "src\TodoApp\TodoApp.csproj", "{A5864C9C-A4D2-403A-BCD9-E40772CAB0FD}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TodoApp.Tests", "tests\TodoApp.Tests\TodoApp.Tests.csproj", "{4C240082-6C0D-4033-AF81-3CBF2B2777AB}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".vscode", ".vscode", "{06810DD9-3B0B-4243-B80C-1AC084087013}"
- ProjectSection(SolutionItems) = preProject
- .vscode\extensions.json = .vscode\extensions.json
- .vscode\launch.json = .vscode\launch.json
- .vscode\tasks.json = .vscode\tasks.json
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{62E14D54-FE91-4A24-A7D2-82661587A2DC}"
- ProjectSection(SolutionItems) = preProject
- .github\actionlint-matcher.json = .github\actionlint-matcher.json
- .github\CODEOWNERS = .github\CODEOWNERS
- .github\CONTRIBUTING.md = .github\CONTRIBUTING.md
- .github\dependabot.yml = .github\dependabot.yml
- .github\FUNDING.yml = .github\FUNDING.yml
- .github\ISSUE_TEMPLATE.md = .github\ISSUE_TEMPLATE.md
- .github\PULL_REQUEST_TEMPLATE.md = .github\PULL_REQUEST_TEMPLATE.md
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{25891391-7F49-4621-8A74-EEAB11D4A778}"
- ProjectSection(SolutionItems) = preProject
- .github\ISSUE_TEMPLATE\bug_report.md = .github\ISSUE_TEMPLATE\bug_report.md
- .github\ISSUE_TEMPLATE\config.yml = .github\ISSUE_TEMPLATE\config.yml
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{86E6F5AB-6537-4A16-B5FD-2B6070F99EE0}"
- ProjectSection(SolutionItems) = preProject
- .github\workflows\build.yml = .github\workflows\build.yml
- .github\workflows\code-scan.yml = .github\workflows\code-scan.yml
- .github\workflows\lint.yml = .github\workflows\lint.yml
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{87734002-38FC-4F18-BB83-E1992C7B98D4}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TodoApp.Benchmarks", "perf\TodoApp.Benchmarks\TodoApp.Benchmarks.csproj", "{422C806D-1B71-4DDC-B62E-B53F18E72449}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A5864C9C-A4D2-403A-BCD9-E40772CAB0FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A5864C9C-A4D2-403A-BCD9-E40772CAB0FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A5864C9C-A4D2-403A-BCD9-E40772CAB0FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A5864C9C-A4D2-403A-BCD9-E40772CAB0FD}.Release|Any CPU.Build.0 = Release|Any CPU
- {4C240082-6C0D-4033-AF81-3CBF2B2777AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4C240082-6C0D-4033-AF81-3CBF2B2777AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4C240082-6C0D-4033-AF81-3CBF2B2777AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4C240082-6C0D-4033-AF81-3CBF2B2777AB}.Release|Any CPU.Build.0 = Release|Any CPU
- {422C806D-1B71-4DDC-B62E-B53F18E72449}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {422C806D-1B71-4DDC-B62E-B53F18E72449}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {422C806D-1B71-4DDC-B62E-B53F18E72449}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {422C806D-1B71-4DDC-B62E-B53F18E72449}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {A5864C9C-A4D2-403A-BCD9-E40772CAB0FD} = {6326B5D0-9981-4488-B46F-9879F825965D}
- {4C240082-6C0D-4033-AF81-3CBF2B2777AB} = {FB647623-961E-4B9C-91F4-E94664F7BEEF}
- {06810DD9-3B0B-4243-B80C-1AC084087013} = {813B2DEF-0737-4242-8AB4-CF0725752CD0}
- {62E14D54-FE91-4A24-A7D2-82661587A2DC} = {813B2DEF-0737-4242-8AB4-CF0725752CD0}
- {25891391-7F49-4621-8A74-EEAB11D4A778} = {62E14D54-FE91-4A24-A7D2-82661587A2DC}
- {86E6F5AB-6537-4A16-B5FD-2B6070F99EE0} = {62E14D54-FE91-4A24-A7D2-82661587A2DC}
- {422C806D-1B71-4DDC-B62E-B53F18E72449} = {87734002-38FC-4F18-BB83-E1992C7B98D4}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {242240D8-68EA-4CBF-8E67-D955866F20ED}
- EndGlobalSection
-EndGlobal
diff --git a/TodoApp.slnx b/TodoApp.slnx
new file mode 100644
index 00000000..3bbc7787
--- /dev/null
+++ b/TodoApp.slnx
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 8dd45a838681707b10bd412c3117f1d43a2f9772 Mon Sep 17 00:00:00 2001
From: Martin Costello
Date: Sun, 6 Apr 2025 06:54:46 -0700
Subject: [PATCH 2/2] Migrate to SLNX
Migrate to the new `.slnx` file format.
---
.editorconfig | 2 +-
build.ps1 | 6 +++---
perf/TodoApp.Benchmarks/OpenApiBenchmarks.cs | 2 +-
startvs.cmd | 2 +-
tests/TodoApp.Tests/TodoAppFixture.cs | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 9aaf3352..522433a2 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -9,7 +9,7 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
-[*.{config,csproj,json,props,ruleset,targets,yml}]
+[*.{config,csproj,json,props,ruleset,slnx,targets,yml}]
indent_size = 2
[*.{received,verified}.{txt,xml,json}]
diff --git a/build.ps1 b/build.ps1
index 0145cc80..31114ae0 100755
--- a/build.ps1
+++ b/build.ps1
@@ -69,7 +69,7 @@ if ($installDotNetSdk -eq $true) {
}
function DotNetTest {
- param([string]$Project)
+ param()
$additionalArgs = @()
@@ -78,7 +78,7 @@ function DotNetTest {
$additionalArgs += "GitHubActions;report-warnings=false"
}
- & $dotnet test $Project --configuration "Release" $additionalArgs
+ & $dotnet test --configuration "Release" $additionalArgs
if ($LASTEXITCODE -ne 0) {
throw "dotnet test failed with exit code $LASTEXITCODE"
@@ -100,5 +100,5 @@ DotNetPublish (Join-Path $solutionPath "src" "TodoApp" "TodoApp.csproj")
if (-Not $SkipTests) {
Write-Host "Testing solution..." -ForegroundColor Green
- DotNetTest(Join-Path $solutionPath "tests" "TodoApp.Tests" "TodoApp.Tests.csproj")
+ DotNetTest
}
diff --git a/perf/TodoApp.Benchmarks/OpenApiBenchmarks.cs b/perf/TodoApp.Benchmarks/OpenApiBenchmarks.cs
index 74f6a31b..ebd082f1 100644
--- a/perf/TodoApp.Benchmarks/OpenApiBenchmarks.cs
+++ b/perf/TodoApp.Benchmarks/OpenApiBenchmarks.cs
@@ -101,7 +101,7 @@ private static string GetContentRoot()
do
{
- string? solutionPath = Directory.EnumerateFiles(directoryInfo.FullName, "TodoApp.sln").FirstOrDefault();
+ string? solutionPath = Directory.EnumerateFiles(directoryInfo.FullName, "TodoApp.slnx").FirstOrDefault();
if (solutionPath is not null)
{
diff --git a/startvs.cmd b/startvs.cmd
index 51b95344..83eacaf0 100644
--- a/startvs.cmd
+++ b/startvs.cmd
@@ -10,7 +10,7 @@ SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use.
SET PATH=%DOTNET_ROOT%;%PATH%
-SET sln=%~dp0TodoApp.sln
+SET sln=%~dp0TodoApp.slnx
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo The .NET SDK has not yet been installed. Run `%~dp0build.ps1` to install it
diff --git a/tests/TodoApp.Tests/TodoAppFixture.cs b/tests/TodoApp.Tests/TodoAppFixture.cs
index 15703939..4c92916c 100644
--- a/tests/TodoApp.Tests/TodoAppFixture.cs
+++ b/tests/TodoApp.Tests/TodoAppFixture.cs
@@ -49,6 +49,6 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
builder.ConfigureLogging(loggingBuilder => loggingBuilder.ClearProviders().AddXUnit(this));
// Configure the correct content root for the static content and Razor pages
- builder.UseSolutionRelativeContentRoot(Path.Combine("src", "TodoApp"));
+ builder.UseSolutionRelativeContentRoot(Path.Combine("src", "TodoApp"), "*.slnx");
}
}