question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect SDK version used when multiple SDKs are installed

See original GitHub issue

The version detection logic in tools.sh/ps1 will use a globally installed “dotnet” if the install directory contains the SDK version requested in global.json.

If there are multiple SDKs installed (one that happens to match the requested version), this can result in using a version later than the one requested. Together with https://github.com/dotnet/arcade/issues/3763 this was resulting in local builds of coreclr using an incorrect SDK version in some cases.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
dagoodcommented, Sep 18, 2019

It sounds like Arcade is inconsistently blocking roll-forward: (I guess because of the “is .NET Core installed?” capability test)

If the roll-forward is desired, I’d expect it to be independent of whether I happen to have a global install of the version listed in global.json.

1reaction
sbomercommented, Sep 18, 2019

@chcosta I only saw this in local builds (and I’m guessing the official/ci builds won’t run into this because they probably don’t have any newer SDKs installed globally).

For example, coreclr currently uses 3.0.100-preview7-012821, and I have a global install of version 5.0.100-alpha1-013789. When I run, for example ./eng/common/msbuild.sh src/build.proj, it uses version 3.0.100-preview7-012821 as expected. However, if I then install 3.0.100-preview7-012821 globally, the same command starts using 5.0.100-alpha1-013789 from the global install. If the roll-forward is desired, I’d expect it to be independent of whether I happen to have a global install of the version listed in global.json.

If I get rid of use_installed_dotnet_cli from coreclr’s eng/configure-toolset.sh, I see the same behavior with build.sh (this is on an empty project, but it illustrates the issue):

>  ./eng/common/build.sh --projects `pwd`/eng/empty.csproj --build -v diag

Without a global install of 3.0.100-preview7-012821:

...
Target "CoreBuild: (TargetId:83)" in file "/Users/sven/src/dotnet/coreclr/.dotnet/sdk/3.0.100-preview7-012821/Microsoft.Common.CurrentVersion.targets"
...

With a global install of 3.0.100-preview7-012821:

...
Target "Build: (TargetId:83)" in file "/Users/sven/bin/sdk/5.0.100-alpha1-013789/Microsoft.Common.CurrentVersion.targets
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

NETSDK1141: Unable to resolve the .NET SDK version as ...
Cause · The SDK version in the global.json file is incorrectly specified. · The SDK version specified in the global.json file was not...
Read more >
c# - .NET SDK's Not Installing Correctly
NET Core SDK installer works, it does not install the SDK correctly for some reason, so you have to do it manually. Go...
Read more >
How to Install multiple versions of .Net SDK on Ubuntu
Net SDK version to the latest available which is 2.2.300 . Is it possible to to install multiple versions of the same SDK?...
Read more >
Why don't any of these methods work for installing .Net ...
sudo apt update sudo apt install dotnet-sdk-6.0. And I got the last version of the SDK: $ dotnet --list-sdks 6.0.400 [/usr/share/dotnet/sdk].
Read more >
How to install multiple .net core versions on Linux? : r/dotnet
Hi, I want to learn F#, but it looks like I need .net6 and 7 installed. For Exercism I need .net7, but I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found