Use specific .NET runtime version#5564
Merged
Merged
Conversation
8b020cd to
3599cb8
Compare
3599cb8 to
0a89119
Compare
DavidBoike
approved these changes
Jun 26, 2026
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.
By default, when doing a self-contained publish, the latest runtime on the machine is chosen to be the bundled runtime. This means that building the same commit can result in a different runtime being chosen each time. With the tests added in #5521 this becomes even more apparent because the tests will start failing when a new runtime has been released but the matching packages haven't been updated yet.
This PR changes the behavior so that a specific runtime is always chosen regardless of the state of the build machine.
This is achieved by setting the
RuntimeFrameworkVersionproperty inCustom.Build.props.RollForwardis disabled as well so that when running in framework-dependent mode (for example, F5 in VS), it will require the specific version and not use something newer on the machine.The
RuntimeFrameworkVersionproperty is now also used inDirectory.Packages.propsto set the version for all packages that tied to the runtime version, making it easy to keep them in sync.Follow-up to #5521