C
C#2w ago
CasterHex

✅ Using dotnet CLI with net5.0 on macos

I've got the dotnet cli working, with the latest 9.x SDK. I'm looking to help a friend with a net 5.0 project. My understanding is that core is backwards compatible and I'd be able to run something like dotnet new console -f net5.0, but that failed as the only available version is 9.x. I've since installed net 5.0 separately using the dotnet-install script, but as that install to a different location, it's still not available to use via dotnet new. Is there a way to allow the dotnet cli to use 5.0 at all?
9 Replies
Angius
Angius2w ago
What does dotnet --list-sdks show?
CasterHex
CasterHexOP2w ago
I was wondering if re-installing via dotnet-install.sh would work if I gave it the --install-dir /usr/local/dotnet option, but I'm wary of potential conflicting conventions for the install output across tools
No description
Angius
Angius2w ago
Any reason you're using dotnet-install.sh in the first place?
CasterHex
CasterHexOP2w ago
couldn't figure how to get it otherwise, unless I've missed something obvious with the dotnet cli
Angius
Angius2w ago
CasterHex
CasterHexOP2w ago
I do tend to make it hard for myself.... cheers
Angius
Angius2w ago
CasterHex
CasterHexOP2w ago
installer worked perfectly, that'll teach me to overcomplicate. thanks very much!
Angius
Angius2w ago
:Ok:

Did you find this page helpful?