-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global.json is rolling backwards under some circumstances #3070
Comments
what does dotnet --info shows you? It should show you the version you are using at the very top. I think this is an issue with --list-sdks only, where it is likely using the MULTI_LEVEL_LOOKUP and not listing the SDKs next to dotnet itself. |
cc @steveharter |
Here is
|
Looks like this is "By design". Filed dotnet/core-setup#3807 on why this design is just not helpful. |
I don't get why this is by design. It's supposed to be exact version or roll forward based on some policy if not found. Under no circumstances should the policy ever roll backward |
--list-sdks will list both the current dotnet.exe as well as the global ones (C:\Program Files\dotnet\sdk) Try setting |
Looks like an issue in fx_muxer_t::resolve_sdk_version where it picks the highest version that matches [major].[minor].[patch/100] instead of returning an error if there is no compatible >= |
Yes, that's that problem. It was somewhat mitigated by the fact that we don't push out previews of patches, but the problem is that we now have non-patches that look like patches to old hostfxr. It gets remitigated with 2.1 preview2 hostfxr that knows about Nxx patch scheme. Further complication: VS/desktop msbuild resolver carries a copy of hostfxr at the moment and that doesn't have a code flow established to get the fix in 15.7. I thought using a preview2 build would unblock Jared here, but it doesn't do to that. We have 3 options for that part of the problem (each with cons in parens)
|
Option 4: backport /100 fix to 2.0.x hostfxr servicing along with fix to this. |
I ran into this while investigating dotnet/sdk#2045. I have 1.1.7 of the SDK installed but no higher 1.x version. A global.json specifying 1.1.8 rolls backwards to 1.1.7.
I've changed the milestone to 2.1.0, as I think we need to fix this. |
That repro invalidates what I said about past mitigation and bumps the severity. Does it repro with rtm hostfxr? |
This is a regression leading to the wrong SDK being picked. We need to fix this. |
@johnbeisner I was under the impression this bug was fixed and that the correct behavior is implemented in 2.1.300. Can you confirm and close this bug if so? |
AFAIK, binding to lower version across 100,200,300 boundaries is fixed in 2.1.300, but we will still bind to latest patch (even if lower than requested)? @johnbeisner is that accurate? If so, I think we need an open issue to track changing that. There was broad agreement to do that on the mail thread. |
I know this is closed, but I just hit my head against what I think is the same issue after cloning and attempting to build the Roslyn repo. I have the 2.1.300 official version installed, but Roslyn wants to use 2.1.300-rtm-008866 (which it downloads during install, and is also set in its Doing a bit of digging reveals that message is emitted here, which refers directly to this issue, hence why I'm guessing it's related. |
I am trying to move the Roslyn repository over to the 2.1 SDK. In doing so I'm not seeing my SDK choices enforced in the way I would expect. Consider the content of my global.json:
Now compare that with the list of SDKS installed on the machine:
There are plenty there but none are the one specified in my global.json. Yet when I do commands like
dotnet build
,dotnet restore
it functions without error.Why isn't this being enforced?
The text was updated successfully, but these errors were encountered: