Skip to content

Name Each Root Workspace Where the Root Holds More Than One .NET Solution or Project #3795

Open

Description

@ptr727

Problem

validate-task.yml's Check C# style step and Run unit tests step keep the bare dotnet format style ... and dotnet test ... call wherever the repository root tracks any .sln, .slnx, or .csproj. A bare call resolves exactly one workspace from the working directory. So a root holding more than one fails both steps with MSB1011 ("more than one project or solution file"). Examples are App.sln beside App.slnx, which dotnet sln migrate leaves behind, two solutions, or a solution beside a project.

This behavior predates the #1938 change on feature/burn-3334. That change keeps the bare call for a root workspace, per the recorded maintainer answer on #1938. The case is a sibling of the one #1938 fixes.

Done when

A root holding more than one solution or project has each one named, or has one chosen by a stated rule, and both steps pass on that layout.

Activity

  1. added
    pre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings
    on Nov 1, 2026
  2. ptr727 commented on Nov 2, 2026

    @ptr727
    OwnerAuthor

    Decision triage: researched question

    Where the repository root holds more than one .NET solution or project, should validate-task.yml name each one, or choose one by a stated rule, and which rule?

    Options, recommended first:

    1. (Recommended) Keep the bare call only where the root holds exactly one workspace, and otherwise use the validate-task Runs dotnet format at the Root Where No Project or Solution Sits There #1938 naming rule. This reuses the rule already chosen on validate-task Runs dotnet format at the Root Where No Project or Solution Sits There #1938 (each tracked solution for style, each *Tests*.csproj by --project for tests), so no new rule is needed. The test step names projects rather than solutions, so an App.sln left beside App.slnx never runs tests twice. WORKFLOW.md D1.6's "root holds no solution or project" wording changes with it. The change fits best in the single resolver Resolve .NET Workspaces Once in a validate-task Composite Action #3791 proposes. Until Resolve .NET Workspaces Once in a validate-task Composite Action #3791 lands, both resolver copies change together because of the identity test.
    2. Choose one root workspace by a stated precedence (.slnx, then .sln, then .csproj, then first by name). Handles the dotnet sln migrate leftover in one run. Where the root holds two distinct solutions, or a solution beside a project it does not list, the rest is skipped silently, a false clean.
    3. Fail with an explicit error naming the root files. Cheapest change, and the caller fixes the layout. It turns a layout dotnet accepts when given an argument into a gate failure, against the "no caller change" direction of the validate-task Runs dotnet format at the Root Where No Project or Solution Sits There #1938 answer.
    4. Leave it and record the limit. No registered C# repo hits it today, since each tracks exactly one root .slnx. The first adopter with such a root gets MSB1011 on both steps.

    Evidence: .github/workflows/validate-task.yml:290-318 and :659-689 on main (dotnet_workspaces, bare call whenever any root .sln/.slnx/.csproj is tracked); WORKFLOW.md:146 (D1.6 states only the root-none rule); #1938 answer #1938 (comment); #3796 (merged, 9e06417); tests/test_release_guards.py:2027 (identity test over the two resolver copies); #3791 (proposed single composite resolver).

    In flight: #3791 and the #1270/#1259 test-project-signal change both touch the same resolver and the *Tests*.csproj glob, so these land through #3791 or in sequence after it.

  3. added
    decisionA question waiting on the maintainer, alone or beside whatever else the issue carries
    on Nov 2, 2026
  4. ptr727 commented on Nov 2, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (2026-11-02, via decision triage): reuse the #1938 naming rule.

    Keep the bare call only where the root holds exactly one workspace. Otherwise name each tracked solution for the style step and each *Tests*.csproj by --project for the test step. Update the WORKFLOW.md D1.6 wording with it. Land it through the #3791 single resolver or in sequence after it, coordinated with the #1270/#1259 test-project-signal change. This issue stays open as work.

  5. removed
    decisionA question waiting on the maintainer, alone or beside whatever else the issue carries
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions