dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.46k stars 4.76k forks source link

Allow us to install multiple .NET SDKs through snap #62252

Open bschaatsbergen opened 3 years ago

bschaatsbergen commented 3 years ago

When trying to install the .NET 6 preview SDK through snap it prompted me (https://snapcraft.io/dotnet-sdk)

$ sudo snap install dotnet-sdk --channel=6.0/beta --classic
snap "dotnet-sdk" is already installed, see 'snap help refresh'

as I already have the .NET 5 sdk installed through snap.

I don't have a proposed solution unless you're able to install snaps with aliases or be able to alter the installed package name?

Perhaps allow us to install snaps in a similiar way the runtime is Installed?

$ snap list | grep dotnet
dotnet-runtime-21    2.1.30                      35     latest/stable    dotnetcore*     -
dotnet-runtime-31    3.1.19                      21     latest/stable    dotnetcore*     -
dotnet-runtime-50    5.0.10                      17     latest/stable    dotnetcore*     -
dotnet-runtime-60    6.0.0-rc.1.21451.13         9      latest/beta      dotnetcore*     -
dotnet-sdk           5.0.401                     140    5.0/stable       dotnetcore*     classic
// dotnet-sdk-60     6.0.100-rc.1.21458.32       142    6.0/beta         dotnetcore*     classic (example)
bschaatsbergen commented 3 years ago

Any status on this?

joeloff commented 3 years ago

Hi

At the moment we do support different runtime versions based on major.minor version, but for the SDK there's only a single channel. For example, SDK 6.0.1xx can target older runtimes and you can acquire those using separate snaps. When the next release comes out you'd simply remove and install the next SDK. My understanding is that early on there was some work around having multiple SDK channels, but that caused more issues.

One scenario I can see where this would be useful is when you have a stable SDK and want to try out the preview of the next major release. Was there another reason for wanting to install multiple SDKs?

The SDK featurebands, e.g. .2xx, 3.xx typically track support for Visual Studio, so when there are multiple supported SDK bands, the snap should always point to the highest feature band, e.g. if we shipped both 6.0.103 and 6.0.409, then an update from 6.0.100 would take you to 6.0.409.

cc @leecow

bschaatsbergen commented 3 years ago

Thanks for the extensive reply @joeloff. As you mentioned and shown in the example I provided, I was indeed running a stable 5.0 SDK and was eager to try out the 6.0.100-rc.1.21458.32 release candidate. I would think this should be possible for people that have .NET SDKs installed via snap, as it's now blocking them from exploring previews/release candidates (unless they install binaries and point applications/editors to that set of binaries (which is how I solved it at the time).

rmannibucau commented 2 weeks ago

+1, keeping .NET 8 is important but starting to use .NET 9 would be neat