Skip to content

Enforce solution RID validation for no-incremental builds - #56379

Merged
baronfel merged 2 commits into
mainfrom
copilot/fix-net-sdk-issue
Sep 29, 2026
Merged

baronfel merged 2 commits into
mainfrom
copilot/fix-net-sdk-issue

Conversation

Copilot AI commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

dotnet build --runtime <RID> solution.sln correctly rejects solution-level RIDs, but adding --no-incremental selected Rebuild and bypassed NETSDK1134.

  • Validation

    • Run _CheckForSolutionLevelRuntimeIdentifier before both Build and Rebuild.
    BeforeTargets="Build;Rebuild;_MTPBuild"
  • Regression coverage

    • Parameterize the existing solution-level RID test to verify NETSDK1134 for both targets.

@azure-pipelines

azure-pipelines Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unexpected behavior of dotnet build with --no-incremental Enforce solution RID validation for no-incremental builds Sep 22, 2026
Copilot AI requested a review from marcpopMSFT September 22, 2026 21:07
@marcpopMSFT
marcpopMSFT marked this pull request as ready for review September 29, 2026 20:50
@marcpopMSFT
marcpopMSFT requested a review from a team as a code owner September 29, 2026 20:50
@marcpopMSFT
marcpopMSFT requested review from baronfel and a balanced review from Copilot September 29, 2026 20:50
@baronfel
baronfel enabled auto-merge September 29, 2026 20:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The Rebuild regression row also runs Build, so it can pass without validating the production fix.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Enforces solution-level RID validation for both normal and non-incremental solution builds.

Changes:

  • Runs RID validation before Rebuild.
  • Parameterizes regression coverage for Build and Rebuild.
File Description
Microsoft.NET.Sdk.Solution.targets Adds Rebuild validation.
GivenThatWeWantToBuildWithARuntimeIdentifier.cs Adds target-specific regression cases.

var buildCommand = new BuildCommand(Log, testAsset.TestRoot, "App.sln");
buildCommand
.Execute($"/p:RuntimeIdentifier={ToolsetInfo.LatestWinRuntimeIdentifier}-x64")
.Execute($"/t:{target}", $"/p:RuntimeIdentifier={ToolsetInfo.LatestWinRuntimeIdentifier}-x64")
@baronfel
baronfel merged commit ab19911 into main Sep 29, 2026
25 checks passed
@baronfel
baronfel deleted the copilot/fix-net-sdk-issue branch September 29, 2026 21:58
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 30, 2026
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.

dotnet build --no-incremental bypasses NETSDK1134

4 participants