ionide / ionide-vscode-fsharp

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

'Cannot start .NET Core language services because `dotnet` was not found.', followed by 'Not in a F# project (still loading....)' #1712

Closed d4span closed 2 years ago

d4span commented 2 years ago

Describe the bug

When I open an F# project in WSL 2, the Ionide plugin is not loaded. Instead, I see the following error:

Cannot start .NET Core language services because dotnet was not found. Consider:

  • setting the FSharp.dotnetRoot settings key to a directory with a dotnet binary,
  • including dotnet in your PATH, or
  • installing .NET Core into one of the default locations.

When I set theFSharp.dotnetRoot settings key and restart VS Code, I see a second error, Not in a F# project (still loading....) in the status bar as soon as I open a *.fs file.

Steps to reproduce

  1. In WSL, create a new F# project in a folder of your choice: dotnet new classlib -lang F#
  2. Open VS Code in that folder: code .
  3. When the error Cannot start .NET Core language services because dotnet was not found. appears, set the FSharp.dotnetRoot settings key and restart VS Code.
  4. Now, the second error appears.

Expected behaviour

The Ionide plugin should load as soon as VS Code opens in an F# project.

Machine info

pkese commented 2 years ago

I had the same problem on normal Ubuntu (desktop) Linux.

After manually setting FSharp.dotnetRoot to /usr/bin it started working for me.
Previously (when it didn't work) FSharp.dotnetRoot was empty.

BTW, my versions are Vscode 1.66.2 + Ionide 6.0.4
I had to downgrade Vscode to previous version because on 1.67.{0,1,2} I was getting some JS stack overflows and Vscode freezes as soon as I started navigating any F# code. Reverting to previous version of Vscode fixed that.

wiredsister commented 2 years ago

Having this problem with

gina@SurfaceBaby:~$ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.301
 Commit:    43f9b18481

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         debian.11-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.301/

Host (useful for support):
  Version: 6.0.6
  Commit:  7cca709db2

.NET SDKs installed:
  6.0.301 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

image

and latest VS Code with an FSharp project. I'm probably doing something dumb, but figured I'd ask here.

baronfel commented 2 years ago

No, you're right! I somehow lost track of doing and releasing this in an ionide update, but it's in the upcoming MEGA UPDATE that includes the update to vscode-languageclient@8.