Skip to content

Commit e6ff767

Browse files
Migrate to .slnx solution format exclusively (#793)
## Overview This PR migrates the repository from the traditional `.sln` format to the modern `.slnx` solution file format exclusively, removing the legacy `.sln` file to avoid CI/CD conflicts. ## Changes - Generated `EssentialCSharp.Web.slnx` using `dotnet sln migrate` command - Removed the traditional `EssentialCSharp.Web.sln` file to prevent "multiple solution files" errors in CI - Updated Dockerfile to reference `.slnx` instead of `.sln` ## Why This Change? The `.slnx` format is the modern solution file format introduced in recent .NET SDK versions. It provides: - **Cleaner format**: 19 lines vs 63 lines (846 bytes vs 3.8KB) - **Better readability**: Human-friendly XML structure - **Forward compatibility**: Prepares the repository for future .NET tooling that may prefer or require this format - **CI/CD compatibility**: Having only one solution file prevents ambiguity errors when dotnet commands don't specify which solution to use By using only the `.slnx` format, we eliminate the MSB1011 error that occurred when multiple solution files were present in the same directory. ## Verification The .slnx solution file has been verified to work correctly: - ✅ `dotnet restore` automatically finds and uses the `.slnx` file - ✅ `dotnet build` works without specifying a solution file - ✅ `dotnet test` runs successfully (54/55 tests pass - one pre-existing network connectivity test failure) - ✅ Dockerfile updated to explicitly reference `.slnx` for Docker builds ## References - [Microsoft Documentation: dotnet sln migrate](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-sln#migrate) <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > run `dotnet sln migrate` (https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-sln#migrate) to add in a .slnx file to live alongside our .sln file for now (.sln for backwards compatibility for now) </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: BenjaminMichaelis <[email protected]>
1 parent 10f90a2 commit e6ff767

File tree

3 files changed

+22
-66
lines changed

3 files changed

+22
-66
lines changed

EssentialCSharp.Web.sln

Lines changed: 0 additions & 63 deletions
This file was deleted.

EssentialCSharp.Web.slnx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path="../.gitattributes" />
4+
<File Path="../azure-pipelines.yml" />
5+
<File Path=".editorconfig" />
6+
<File Path="Directory.Build.props" />
7+
<File Path="Directory.Build.targets" />
8+
<File Path="Directory.Packages.props" />
9+
<File Path="EssentialCSharp.Web/Dockerfile" />
10+
<File Path="global.json" />
11+
<File Path="nuget.config" />
12+
<File Path="README.md" />
13+
</Folder>
14+
<Project Path="EssentialCSharp.Chat.Shared/EssentialCSharp.Chat.Common.csproj" />
15+
<Project Path="EssentialCSharp.Chat.Tests/EssentialCSharp.Chat.Tests.csproj" />
16+
<Project Path="EssentialCSharp.Chat/EssentialCSharp.Chat.csproj" />
17+
<Project Path="EssentialCSharp.Web.Tests/EssentialCSharp.Web.Tests.csproj" />
18+
<Project Path="EssentialCSharp.Web/EssentialCSharp.Web.csproj" />
19+
</Solution>

EssentialCSharp.Web/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ RUN --mount=type=secret,id=nuget_auth_token \
1616
auth_token=$(cat /run/secrets/nuget_auth_token) && \
1717
export VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [{\"endpoint\":\"https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json\", \"password\":\"$auth_token\"}]}"; \
1818
fi && \
19-
dotnet restore "EssentialCSharp.Web.sln" -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED && \
20-
dotnet build "EssentialCSharp.Web.sln" -c Release --no-restore -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED -p:ReleaseDateAttribute=True && \
21-
dotnet publish "EssentialCSharp.Web.sln" -c Release -p:PublishDir=/app/publish -p:UseAppHost=false --no-build
19+
dotnet restore "EssentialCSharp.Web.slnx" -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED && \
20+
dotnet build "EssentialCSharp.Web.slnx" -c Release --no-restore -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED -p:ReleaseDateAttribute=True && \
21+
dotnet publish "EssentialCSharp.Web.slnx" -c Release -p:PublishDir=/app/publish -p:UseAppHost=false --no-build
2222

2323
FROM base AS final
2424
WORKDIR /app

0 commit comments

Comments
 (0)