Build on a named SDK, and keep the .NET 8 runtime for the net8.0 tests - #64
Merged
Conversation
This repository commits packages.lock.json and restores with --locked-mode, but `setup-dotnet` took `10.0.x` -- whatever the runner had that day. Those two settings disagree: a lock file is a claim about what restore resolves, and the SDK is one of the inputs that decides it. LakeWright.NET went red this week on exactly that, when its runner crossed a feature band and `Microsoft.AspNetCore.App.Internal.Assets` moved with it. This repository is not exposed to that package today -- its Web samples target net8.0, where the Web SDK does not add it -- so this is fixing the class while it is cheap rather than after an instance. The `8.0.x` line stays. It is not there to choose the SDK; it is there so the net8.0 half of the test matrix has a runtime to run on, and pinning the build SDK does not provide that. So each job now installs 8.0.x *and* the SDK named in global.json. Verified on a local 10.0.303: restore --locked-mode and build -c Release both exit 0 across net8.0 and net10.0.
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.
This repository commits
packages.lock.jsonand restores with--locked-mode, butsetup-dotnettook10.0.x— whatever the runner had that day. Those two settings disagree: a lock file is a claim about what restore resolves, and the SDK is one of the inputs that decides it.LakeWright.NETwent red this week on exactly that, when its runner crossed a feature band andMicrosoft.AspNetCore.App.Internal.Assetsmoved with it, failingNU1004against a lock file nobody had touched.This repository is not exposed to that package today — its Web samples target
net8.0, where the Web SDK does not add it. So this fixes the class while it is cheap, rather than after an instance.The part that needed care
The
8.0.xline stays. It is not there to choose the SDK — it is there so thenet8.0half of the test matrix has a runtime to run on, and pinning the build SDK does not provide that. Each job now installs8.0.xand the SDK named inglobal.json. Dropping it would have been the easy way to break the tests quietly.Verified locally on 10.0.303:
restore --locked-modeandbuild -c Releaseboth exit 0 across net8.0 and net10.0.