How can I install two versions of .NET for Rider?

us flag

I have installed both Rider and dotnet-sdk with Snap, so that I can debug .NET projects. However, I now need to work on an older solution that runs on an older version of .NET.

How can I install another version of .NET and still work on both projects?

us flag

You can achieve this by installing two .NET snaps in parallel. Rider will detect both versions and you can pick one per solution.

If you have .NET already installed, uninstall it:

sudo snap remove dotnet-sdk
# this is to avoid confusion between versions

Enable parallel instances:

sudo snap set system experimental.parallel-instances=true
# see references for details

Now install both versions in parallel (we'll use 5.0 and 3.1 as examples), and create aliases:

sudo snap install --classic --unaliased dotnet-sdk_50 --channel=5.0/stable
sudo snap install --classic --unaliased dotnet-sdk_31 --channel=3.1/stable
sudo snap alias dotnet-sdk_50.dotnet dotnet50
sudo snap alias dotnet-sdk_31.dotnet dotnet31
# aliases picked based on Microsoft convention

When you next start Rider it will automatically detect all available versions. You can set your preference per solution, and/or set a default for new solutions.

.NET Core CLI executable path dropdown with both 3.1 and 5.0 visible



Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.