Allow NU5104 in MSBuild#3228
Merged
Merged
Conversation
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.
Co-authored-by: Matt Mitchell <[email protected]>
premun
approved these changes
Nov 6, 2025
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.
Backport of #3051 to main
/cc @akoeplinger @rainersigwald