Repository navigation
Watch .slnx solution files as well as .sln - #51
Open
xperiandri wants to merge 2 commits into
Open
xperiandri wants to merge 2 commits into
xperiandri wants to merge 2 commits into
Conversation
The watcher of the solution file was set up only when the name of the solution ended in ".sln", and its rename handler checked the same. A solution in the newer, XML based, .slnx format got no watcher, so a change of the solution (such as adding a project) did not reload the list of .resx files. The project file watcher was not affected. IsSolutionFileName recognizes both extensions, without regard to case, and both checks use it. The check in the rename handler was case sensitive before and is not any more. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Nine tests for IsSolutionFileName: the .sln and .slnx formats, different case, a project file and a solution filter, an extension in the middle of the path, an empty name and null. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A solution in the
.slnxformat (the XML based solution format that the .NET SDK 9.0.200 and later and MSBuild 17.13 and later read) is not recognized by the extension as a solution file. For such a solution, a change of the solution file, such as adding a project, does not reload the list of.resxfiles. The watcher of the project files is not affected.This pull request makes the watcher and the handler of renamed files accept
.slnand.slnx, without regard to case, and adds nine tests for the new helper.Cause, changes, things to know and verification
Cause
StringResVizPackagesets up the watcher of the solution file only when the name ends in.sln, and the handler of renamed files checks the same. For a.slnxsolution that watcher is never set up.Changes
StringExtensions.IsSolutionFileNamerecognizes the.slnand.slnxextensions, without regard to case.WatchForSolutionOrProjectChangesandSlnWatcher_Renameduse it. The check in the rename handler compared case sensitively before and does not any more.StringExtensionsTestsclass: both formats, different case, a project file, a solution filter, an extension in the middle of the path, an empty name andnull.Things to know
.slnx, which is Switch the solution to the.slnxformat #53 now (the earlier Add instructions and configuration for AI coding agents #50 was closed in favor of the chain Switch the solution to the.slnxformat #53 to Build withdotnet build#58). This pull request and the chain are independent of each other.<Compile Include="StringExtensionsTests.cs" />that this pull request adds is not needed, so whichever of the two is merged second needs a trivial rebase.Verification
-p:TargetFrameworkVersion=v4.8, because the .NET Framework 4.8.1 targeting pack is not installed on the machine that prepared this change. All 13 tests pass: the 4 existing ones and the 9 new ones..slnxformat and change the solution file (for example by adding a project): the "String Resource Visualizer" pane of the Output window should then show "Reloading list of resx files.".Build). The build, with the .NET Framework 4.8.1 targeting pack of the runner, and the test step succeed. The stepPublish Test Resultsthen fails, because the third-party actionEnricoMi/publish-unit-test-result-action/windows@v2finds no Python interpreter on thewindows-2022image (No python3 interpreter found); it fails in the same way on the unchanged code ofmain(run in the fork), so this change does not cause it.🤖 Generated with Claude Code