Skip to content

Use specific .NET runtime version#5564

Merged
bording merged 4 commits into
masterfrom
lock-runtime-version
Jun 29, 2026
Merged

Use specific .NET runtime version#5564
bording merged 4 commits into
masterfrom
lock-runtime-version

Conversation

@bording

@bording bording commented Jun 26, 2026

Copy link
Copy Markdown
Member

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 RuntimeFrameworkVersion property in Custom.Build.props. RollForward is 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 RuntimeFrameworkVersion property is now also used in Directory.Packages.props to set the version for all packages that tied to the runtime version, making it easy to keep them in sync.

Follow-up to #5521

@bording bording force-pushed the lock-runtime-version branch 3 times, most recently from 8b020cd to 3599cb8 Compare June 26, 2026 21:52
@bording bording force-pushed the lock-runtime-version branch from 3599cb8 to 0a89119 Compare June 26, 2026 22:15
@bording bording marked this pull request as ready for review June 29, 2026 17:32
@bording bording merged commit e1f1e70 into master Jun 29, 2026
33 checks passed
@bording bording deleted the lock-runtime-version branch June 29, 2026 19:55
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.

2 participants