sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Support trailing commas and comments in .slnf files

Open Copilot opened this issue 3 months ago • 3 comments

  • [x] Replace net8.0 with $(CurrentTargetFramework) in App.csproj and Lib.csproj
  • [x] Update .github/copilot-instructions.md to document using $(CurrentTargetFramework) for test projects
  • [x] Verify all tests still pass (4/4 tests passed)
Original prompt

This section details on the original issue you should resolve

<issue_title>Revise CreateFromFilteredSolutionFile implementation for trailing comma (and allowing comments)</issue_title> <issue_description>The current implementation of this method doesn't seem to allow trailing commas (and comments).

MSBuild supported trailing commas (and comments) of slnf files in https://github.com/dotnet/msbuild/pull/6346

https://github.com/dotnet/sdk/blob/f578225fe1fdd93db9efac273562b3709db9e8e9/src/Cli/dotnet/SlnFileFactory.cs#L92

@baronfel @rainersigwald Another discrepancy due to not having a unified implementation/helper for how to parse solutions and solution filters. Not specific to test command this time :) </issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes dotnet/sdk#51929

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Dec 02 '25 00:12 Copilot

@copilot please replace the two new net8.0 target frameworks you added with $(CurrentTargetFramework). Please update the copilot instructions to let future copilots know to always use $(CurrentTargetFramework) by default when creating new test projects.

marcpopMSFT avatar Dec 05 '25 21:12 marcpopMSFT

Tested in codespaces with a slnf that had trailing commas and comments.

marcpopMSFT avatar Dec 05 '25 21:12 marcpopMSFT

@copilot please replace the two new net8.0 target frameworks you added with $(CurrentTargetFramework). Please update the copilot instructions to let future copilots know to always use `$(CurrentTarg...

Done in 5fac8cb. Replaced both instances of net8.0 with $(CurrentTargetFramework) and added the guidance to the copilot instructions file.

Copilot avatar Dec 05 '25 21:12 Copilot