Rider ignores mise environment and hard-defaults to system .NET SDK /usr/bin/dotnet (Arch Linux)

Hi everyone,

I am running into a frustrating toolchain resolution issue on Arch Linux.

The Context: I use mise (similar to asdf) to manage my .NET versions per project (specifically .NET 9). Recently, I installed the godot-mono package via the system package manager, which pulled in .NET 8 as a hard dependency and placed it in /usr/bin/dotnet.

The Issue: Since that system-wide installation, Rider refuses to use my mise environment consistently for my regular C# projects.

Interestingly, there is a weird discrepancy: The Build process actually respects the mise environment and compiles the project correctly using the local SDK. However, when I Run or Debug the application, Rider completely ignores the local environment and falls back to the system-wide .NET 8 runtime from /usr/bin/dotnet.

What I've tried (and failed):

  1. Launching Rider directly from a terminal where the mise environment is fully active and which dotnet points to the mise path.
  2. Setting DOTNET_ROOT to the mise installation path.
  3. Adding the custom PATH explicitly to launchSettings.json.

None of these force the Run/Debug configurations to respect the local environment. It seems Rider's execution runtime prioritizes the default system path over user-injected variables, even though MSBuild evaluation works fine.

Is there a specific setting in Rider (or a Registry flag) where I can explicitly point the Run/Debug configuration to the mise .NET executable, or force it to respect the shell's $PATH priority?

Thanks!

0
4 comments

Hello,

What do you have under File | Settings | Build, Execution, Deployment | Toolset and Build as “.NET CLI executable path” and MSBuild version? Does it point to the mise installation, or to the system one?

What you can try is to experiment with the Run Configuration (Run | Edit Configurations):

  • Specify the environments necessary for the mise installed dotnet to be used in an .env file then point that file in “Environment variables” for the run configuration.
  • Or for the specific run configuration, select proper dotnet executable in the Runtime field:

Tell me how it is going. Have a nice day!

0

Hi,

Thanks for getting back to me with those suggestions.

Regarding your questions, here are my findings:

1. Toolset and Build Settings:

My settings under File | Settings | Build, Execution, Deployment | Toolset and Build are actually correctly pointing to the mise installation. The .NET CLI executable path and MSBuild are detecting the local mise environment properly.

2. Run Configuration Workaround:

I followed your suggestion and experimented with the Run Configuration (Run | Edit Configurations). As you can see in the second attachment, I have explicitly:

  • Overridden the Environment variables to inject the mise PATH.
  • Changed the Runtime field to explicitly point to the mise dotnet executable (/home/manhtq/.local/share/mise/dotnet-root/dotnet).

The Result: Unfortunately, it is still not working. Even with these explicit manual overrides in the Run Configuration, the application fails to run correctly using the local environment. Here is the console output:

/home/manhtq/code/WatchStoreApp/WatchStoreApp/bin/Debug/net9.0/WatchStoreApp
You must install or update .NET to run this application.

App: /home/manhtq/code/WatchStoreApp/WatchStoreApp/bin/Debug/net9.0/WatchStoreApp
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '9.0.0' (x64)
.NET location: /usr/share/dotnet

The following frameworks were found:
  8.0.27 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=9.0.0&arch=x64&rid=arch-x64&os=arch

Process finished with exit code 150.

Thanks!

0

Thank you! Now I see. I reproduced the same problem on my end. I assume this is a bug: I registered this: RIDER-139472 Rider ignores mise-installed dotnet and uses system one, despite everything is set to use the mise-installed those . Development team will take a look.

I mentioned a couple of wokarounds. I found no other way to make it work. For some reason, Rider wrongly uses the dotnet installation that appears comes with `godot-mono` package.

Hope that helps!

1

Thanks a lot for reproducing the issue and creating the ticket! Appreciate the help!

0

Please sign in to leave a comment.