Skip to content

Migrate solution to slnx format - #533

Closed
mgravell wants to merge 1 commit into
masterfrom
marc/slnx
Closed

Migrate solution to slnx format#533
mgravell wants to merge 1 commit into
masterfrom
marc/slnx

Conversation

@mgravell

@mgravell mgravell commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Replaces NRedisStack.sln with NRedisStack.slnx via 'dotnet sln migrate', and renames the ReSharper settings sidecar to match (association is by filename).

CI never referenced the solution by name, but every job relies on implicit solution discovery, which requires an SDK >= 9.0.200 to find a .slnx:

  • run-tests action: decouple the build SDK from the target framework. A new build-sdk-version input drives global.json, while dotnet-version keeps its per-leg meaning of 'target TFM'. Both are installed so the target runtime is available to 'dotnet test -f'. Previously global.json was pinned to the target version, which handed the net8.0 leg an SDK that cannot read .slnx.
  • linter: use the SDK's built-in 'dotnet format' instead of the legacy standalone dotnet-format tool, which cannot discover a .slnx.
  • integration (Windows): pin the SDK rather than relying on the runner image.

Note

Medium Risk
Changes affect CI, formatting, and release packaging rather than library runtime code, but a misconfigured SDK matrix could break multi-TFM test legs or releases.

Overview
Replaces NRedisStack.sln with NRedisStack.slnx and points VS Code’s dotnet.defaultSolution at the new file so tooling uses the XML solution format.

Because .slnx discovery needs SDK ≥ 9.0.200, CI is updated so builds don’t break on older target frameworks (e.g. net8.0 matrix legs). The run-tests composite action adds build-sdk-version: it installs both the build SDK and the target runtime, and global.json is pinned to the build SDK instead of the per-leg target version. Integration (Windows) and NuGet release explicitly install .NET 10; the linter drops the global dotnet-format tool and runs the SDK’s built-in dotnet format after setting up .NET 10.

Reviewed by Cursor Bugbot for commit ffb2ac8. Bugbot is set up for automated code reviews on this repo. Configure here.

Replaces NRedisStack.sln with NRedisStack.slnx via 'dotnet sln migrate',
and renames the ReSharper settings sidecar to match (association is by
filename).

CI never referenced the solution by name, but every job relies on implicit
solution discovery, which requires an SDK >= 9.0.200 to find a .slnx:

- run-tests action: decouple the build SDK from the target framework. A new
  build-sdk-version input drives global.json, while dotnet-version keeps its
  per-leg meaning of 'target TFM'. Both are installed so the target runtime
  is available to 'dotnet test -f'. Previously global.json was pinned to the
  target version, which handed the net8.0 leg an SDK that cannot read .slnx.
- linter: use the SDK's built-in 'dotnet format' instead of the legacy
  standalone dotnet-format tool, which cannot discover a .slnx.
- integration (Windows): pin the SDK rather than relying on the runner image.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffb2ac86ca

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

find . -name '*.csproj' | xargs -I {} sed -E -i "s|<TargetFrameworks(.*)>.*</TargetFrameworks>|<TargetFramework\1>${CLR_VERSION}</TargetFramework>|" {}
find . -name '*.csproj' | xargs cat
jq -n --arg version "$INPUT_DOTNET_VERSION" '{"sdk":{"version":$version,"rollForward":"latestMinor"}}' > global.json
jq -n --arg version "$INPUT_BUILD_SDK_VERSION" '{"sdk":{"version":$version,"rollForward":"latestMinor"}}' > global.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Write a full SDK version to global.json

When the action uses the new default build-sdk-version: 10.0 (or any caller passes a channel-style value that setup-dotnet accepts), this writes that value directly as sdk.version in global.json. The .NET global.json schema requires the full SDK version and explicitly does not support values like 10 or 10.0 (https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#version), so the pin added for .slnx discovery is invalid and subsequent dotnet restore/build/pack can fall back to whatever SDK the runner happens to have installed instead of the intended build SDK. Use a full feature-band version or the resolved setup-dotnet output here.

Useful? React with 👍 / 👎.

Comment thread NRedisStack.slnx
@@ -0,0 +1,16 @@
<Solution>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update reusable workflow for .slnx

When this repo is built through the existing .github/workflows/reusable.yml workflow_call with its documented 6/7/8 SDK inputs, the job still installs only SDKs 6, 7, and 8, writes that SDK into global.json, and then runs implicit dotnet restore. After replacing the .sln with only this .slnx, those SDKs cannot discover/build the solution because .NET CLI support for SLNX starts in SDK 9.0.200 (https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/), so that reusable workflow breaks even though the composite test action was updated; please either keep a legacy .sln or decouple the reusable workflow's build SDK the same way.

Useful? React with 👍 / 👎.

@mgravell mgravell closed this Jul 29, 2026
@mgravell

Copy link
Copy Markdown
Collaborator Author

meh, not worth it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant