ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
849 stars 276 forks source link

`F# client: couldn't create connection to server.` when the system env `DOTNET_ROOT` is not set #1996

Open sasasqt opened 3 months ago

sasasqt commented 3 months ago

Describe the bug

F# client: couldn't create connection to server. when the env DOTNET_ROOT is not set

Steps to reproduce

install dotnet using micromamba/conda in the virtual environment or remove DOTNET_ROOT from the system env if installed directly from microsoft.

Link to sample reproduction

Expected behaviour

use fsharp.dotnetroot to set the env DOTNET_ROOT

Screenshots

image

Machine info

Additional context

the dotnet(sdk,rt, etc) instance is installed and managed via micromamba/conda. micromamba/conda does not pollute the system envs and kept different versions of the dotnet separated in different virtual envs & folders, which is what I prefer. The issue now is that the env DOTNET_ROOT is only automatically set when the virtual env is activated and remains unset otherwise. I can not find any ways to set the env for one specific extension in vscode. My temporal fix: add one line of code to the fsharp.js image