[build] use $(RollForward) Major for console apps #778
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.
Context: https://natemcmaster.com/blog/2019/01/09/netcore-primitives-3/
Context: https://github.com/dotnet/designs/blob/main/accepted/2019/runtime-binding.md#rollforward
I've seen an error on a CI machine that only has .NET 5 & 6
installed:
By default, a .NET Core app will only "roll forward" to a patch
release, since
generator.csprojtargetsnetcoreapp3.1it wouldonly successfully run on .NET Core 3.1.x.
To change this behavior you can modify
generator.runtimeconfig.json:Majorappears to be what we want to enable it to pick a newer dotnetruntime/sdk. This would allow a .NET Core 3.x to be used or some newer
version if no .NET Core 3.x is found:
We can also use the
$(RollForward)MSBuild property as analternative to creating the
*.runtimeconfig.jsonfile.I think it's likely best to just use this value across the board, as
there isn't a reason we wouldn't want
generatoror the othercommand-line tools to run on newer .NET versions.