Allow NU5104 in MSBuild#3051
Merged
mmitche merged 2 commits intodotnet:release/10.0.1xxfrom Oct 23, 2025
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.
mthalman
approved these changes
Oct 22, 2025
mmitche
reviewed
Oct 23, 2025
Co-authored-by: Matt Mitchell <mmitche@microsoft.com>
Member
|
I've applied @mmitche's suggestion preemptively so we can have a passing build soon. @rainersigwald can choose to accept it or not |
Member
Author
|
That works for me. |
Member
|
port to main? |
Member
|
/backport to main |
Contributor
|
Started backporting to |
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.
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
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.