Skip to content

Allow NU5104 in MSBuild#3228

Merged
akoeplinger merged 2 commits into
mainfrom
backport/pr-3051-to-main
Nov 6, 2025
Merged

Allow NU5104 in MSBuild#3228
akoeplinger merged 2 commits into
mainfrom
backport/pr-3051-to-main

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Backport of #3051 to main

/cc @akoeplinger @rainersigwald

rainersigwald and others added 2 commits November 5, 2025 09:16
Fixes dotnet/source-build#5376.

When MSBuild exposes a stable version, but dotnet/runtime does not, VMR
builds can fail with a warning-as-error like

    .../NuGet.Build.Tasks.Pack.targets(221,5): error NU5104: Warning As Error: A stable release of a package should not have a prerelease dependency. Either modify the version spec of dependency "System.Formats.Nrbf [10.0.0-rtm.25514.101, )" or update the version field in the nuspec. [/home/tester/workdir/dotnet/src/msbuild/src/Tasks/Microsoft.Build.Tasks.csproj]

This is an error we want to keep in the MSBuild repo’s standalone build,
so that the official NuGet packages we ship don't violate the rule, but
it is not helpful in a unified build where the packages won't be
published and we always want to have a consistent, unified set of
references to what is building.

Avoid this by suppressing the warning for any project in the MSBuild
repo, conditional on whether we're in a source-build scenario.
@dotnet-policy-service dotnet-policy-service Bot requested a review from a team November 5, 2025 09:16
@premun premun changed the title [main] Allow NU5104 in MSBuild Allow NU5104 in MSBuild Nov 6, 2025
@akoeplinger akoeplinger enabled auto-merge (squash) November 6, 2025 15:14
@akoeplinger akoeplinger merged commit 68bfa36 into main Nov 6, 2025
11 checks passed
@akoeplinger akoeplinger deleted the backport/pr-3051-to-main branch November 6, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants