最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dotnet sdk - How to Properly Configure Side-by-Side .NET SDK Installations on Linux? - Stack Overflow

programmeradmin3浏览0评论

I am trying to set up side-by-side installations of .NET SDK versions on Linux Mint 21.3. Currently, I have installed:

  • .NET SDK 9.0.201 (located in /usr/share/dotnet-sdk-9.0.201/)
  • .NET SDK 8.0.407 (located in /usr/share/dotnet-sdk-8.0.407/)

I set up my environment variables in /etc/profile.d/dotnet.sh:

export DOTNET_MULTILEVEL_LOOKUP=0
export PATH=/usr/share/dotnet-sdk-9.0.201:/usr/share/dotnet-sdk-8.0.407:$PATH
export DOTNET_ROOT=/usr/share/dotnet-sdk-8.0.407

However, when I run dotnet --info, it only detects .NET 9:

.NET SDK:
 Version:           9.0.201
 Commit:            071aaccdc2
 Workload version:  9.0.200-manifests.21502d11
 MSBuild version:   17.13.13+1c2026462

I have verified that .NET 8 is extracted correctly:

ls -l /usr/share/dotnet-sdk-8.0.407/

I also tried manually running:

/usr/share/dotnet-sdk-8.0.407/dotnet --info

and it correctly shows .NET 8. But the global dotnet --info does not list it.

I've tried:

  • Updating /etc/profile.d/dotnet.sh and reloading with source /etc/profile.d/dotnet.sh

  • Manually setting DOTNET_ROOT=/usr/share/dotnet-sdk-8.0.407 before running dotnet --info

  • Checking if /usr/local/bin/dotnet is pointing to the wrong location

  • Running dotnet --list-sdks, which only shows version 9

How can I properly configure my environment so that both .NET SDK versions are available and dotnet --list-sdks recognizes both?

发布评论

评论列表(0)

  1. 暂无评论