ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

"Not in a F# project (Still loading...)", but the folder is a dotnet scaffolded .fsproj

Open ladaltamirano opened this issue 2 years ago • 43 comments

Describe the bug

I get a "Not in a F# project (Still loading...)" in status bar, but the folder is a dotnet scaffolded .fsproj

Steps to reproduce

Scaffolded a fs project. cd into the directory. Opened it in vscode. I set up a global.json with net core 5 version installed in my host. Set net core version 5 in .fsproj Set the dotnet variable from settings Set path env var ordered first to the dotnet core path

Expected behaviour

Ionide should recognize this fsproj

Screenshots

image image image

Machine info

  • OS: Windows 10 Pro
  • .NET SDK version: [5.0.100]
  • Ionide version: 6.0.1

Additional context

Full F# Output

Unhandled exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'c:\repos\fs\FirstIonideProject\dotnet' with working directory 'c:\repos\fs\FirstIonideProject'. The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Ionide.ProjInfo.SdkDiscovery.execDotnet(DirectoryInfo cwd, FileInfo binaryFullPath, IEnumerable`1 args) in /_//src/Ionide.ProjInfo/Library.fs:line 34
   at Ionide.ProjInfo.SdkDiscovery.versionAt(DirectoryInfo cwd, FileInfo dotnetBinaryPath) in /_//src/Ionide.ProjInfo/Library.fs:line 105
   at Ionide.ProjInfo.Init.init(DirectoryInfo workingDirectory, FSharpOption`1 dotnetExe) in /_//src/Ionide.ProjInfo/Library.fs:line 244
   at [email protected](Boolean backgroundServiceEnabled, Boolean projectGraphEnabled, DirectoryInfo stateDirectory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 111
   at System.CommandLine.Handler.<>c__DisplayClass21_0`3.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at [email protected]() in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 0
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()
[Info  - 19:58:07] Connection to server got closed. Server will restart.
Unhandled exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'c:\repos\fs\FirstIonideProject\dotnet' with working directory 'c:\repos\fs\FirstIonideProject'. The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Ionide.ProjInfo.SdkDiscovery.execDotnet(DirectoryInfo cwd, FileInfo binaryFullPath, IEnumerable`1 args) in /_//src/Ionide.ProjInfo/Library.fs:line 34
   at Ionide.ProjInfo.SdkDiscovery.versionAt(DirectoryInfo cwd, FileInfo dotnetBinaryPath) in /_//src/Ionide.ProjInfo/Library.fs:line 105
   at Ionide.ProjInfo.Init.init(DirectoryInfo workingDirectory, FSharpOption`1 dotnetExe) in /_//src/Ionide.ProjInfo/Library.fs:line 244
   at [email protected](Boolean backgroundServiceEnabled, Boolean projectGraphEnabled, DirectoryInfo stateDirectory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 111
   at System.CommandLine.Handler.<>c__DisplayClass21_0`3.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at [email protected]() in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 0
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()
[Info  - 19:58:07] Connection to server got closed. Server will restart.
Unhandled exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'c:\repos\fs\FirstIonideProject\dotnet' with working directory 'c:\repos\fs\FirstIonideProject'. The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Ionide.ProjInfo.SdkDiscovery.execDotnet(DirectoryInfo cwd, FileInfo binaryFullPath, IEnumerable`1 args) in /_//src/Ionide.ProjInfo/Library.fs:line 34
   at Ionide.ProjInfo.SdkDiscovery.versionAt(DirectoryInfo cwd, FileInfo dotnetBinaryPath) in /_//src/Ionide.ProjInfo/Library.fs:line 105
   at Ionide.ProjInfo.Init.init(DirectoryInfo workingDirectory, FSharpOption`1 dotnetExe) in /_//src/Ionide.ProjInfo/Library.fs:line 244
   at [email protected](Boolean backgroundServiceEnabled, Boolean projectGraphEnabled, DirectoryInfo stateDirectory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 111
   at System.CommandLine.Handler.<>c__DisplayClass21_0`3.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at [email protected]() in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 0
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()
[Info  - 19:58:08] Connection to server got closed. Server will restart.
Unhandled exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'c:\repos\fs\FirstIonideProject\dotnet' with working directory 'c:\repos\fs\FirstIonideProject'. The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Ionide.ProjInfo.SdkDiscovery.execDotnet(DirectoryInfo cwd, FileInfo binaryFullPath, IEnumerable`1 args) in /_//src/Ionide.ProjInfo/Library.fs:line 34
   at Ionide.ProjInfo.SdkDiscovery.versionAt(DirectoryInfo cwd, FileInfo dotnetBinaryPath) in /_//src/Ionide.ProjInfo/Library.fs:line 105
   at Ionide.ProjInfo.Init.init(DirectoryInfo workingDirectory, FSharpOption`1 dotnetExe) in /_//src/Ionide.ProjInfo/Library.fs:line 244
   at [email protected](Boolean backgroundServiceEnabled, Boolean projectGraphEnabled, DirectoryInfo stateDirectory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 111
   at System.CommandLine.Handler.<>c__DisplayClass21_0`3.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at [email protected]() in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 0
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()
[Info  - 19:58:09] Connection to server got closed. Server will restart.
Unhandled exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'c:\repos\fs\FirstIonideProject\dotnet' with working directory 'c:\repos\fs\FirstIonideProject'. The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Ionide.ProjInfo.SdkDiscovery.execDotnet(DirectoryInfo cwd, FileInfo binaryFullPath, IEnumerable`1 args) in /_//src/Ionide.ProjInfo/Library.fs:line 34
   at Ionide.ProjInfo.SdkDiscovery.versionAt(DirectoryInfo cwd, FileInfo dotnetBinaryPath) in /_//src/Ionide.ProjInfo/Library.fs:line 105
   at Ionide.ProjInfo.Init.init(DirectoryInfo workingDirectory, FSharpOption`1 dotnetExe) in /_//src/Ionide.ProjInfo/Library.fs:line 244
   at [email protected](Boolean backgroundServiceEnabled, Boolean projectGraphEnabled, DirectoryInfo stateDirectory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 111
   at System.CommandLine.Handler.<>c__DisplayClass21_0`3.<SetHandler>b__0(InvocationContext context)
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at [email protected]() in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 0
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()
[Error - 19:58:09] Connection to server got closed. Server will not be restarted.

ladaltamirano avatar Apr 24 '22 23:04 ladaltamirano

So I haven't looked into anything else, but as of Ionide 6, .net 6 is required. You'll want to make sure that you have that installed. .net 5 goes out of support in about 2 weeks.

baronfel avatar Apr 24 '22 23:04 baronfel

I have this problem too. I'm using Manjaro Linux, VSCode 1.66.2, Ionide 6.0.2, And dotnet-sdk 6.0.102.

1651609523_2125_03m2022_2565May 1651609511_2125_03m2022_2559May

tomboland avatar May 03 '22 20:05 tomboland

If I click on the message (Yellow text in the blue status bar, near the bottom right of the first image), I get this: 1651611330_2155_03m2022_579May

tomboland avatar May 03 '22 20:05 tomboland

I built the extension from source, and this is the output I get when running it, with the same project as above:

(node:531994) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `code --trace-deprecation ...` to show where the warning was created)
DOTNET PATH: /usr/share/dotnet/dotnet
FSAC (NETCORE): '/home/tom/ionide-vscode-fsharp/release/bin/fsautocomplete.dll'
Error activating FSAC: Error: Connection to server got closed. Server will not be restarted.
[LineLens] Activating
[LineLens] Config Changed event
[LineLens] Config Changed event
[LineLens] Installing
[LineLens] Installing
[LineLens] Installed
[LineLens] Installed
Error while activating feature 'msbuild': Error: command 'MSBuild.buildSelected' already exists
[Debugger] registering debug provider
[GitIgnore] gitignore path: /home/tom/WasteOfSpace/.gitignore
[GitIgnore] gitignore path: /home/tom/WasteOfSpace/.gitignore
[PipelineHints] Activating
[PipelineHints] Config Changed event
[PipelineHints] Config Changed event
[PipelineHints] Installing
[PipelineHints] Installing
[PipelineHints] Installed
[PipelineHints] Installed
[InlayHints] Activating F# inlay hints
Error loading projects: Error: Language client is not ready yet
Error while activating feature 'analyzers': Error: Language client is not ready yet
[InlayHints] Getting inlay hints for /home/tom/WasteOfSpace/Program.fs
rejected promise not handled within 1 second: Error: Language client is not ready yet
stack trace: Error: Language client is not ready yet
    at O.sendRequest (/home/tom/ionide-vscode-fsharp/release/webpack:/node_modules/vscode-languageclient/lib/common/client.js:1852:19)
    at Ti (/home/tom/ionide-vscode-fsharp/release/webpack:/src/Core/LanguageService.fs:175:13)
    at /home/tom/ionide-vscode-fsharp/release/webpack:/src/Components/InfoPanel.fs:206:32
    at Object.then (/home/tom/ionide-vscode-fsharp/release/webpack:/Promise.fs:624:21)
    at u (/home/tom/ionide-vscode-fsharp/release/webpack:/Promise.fs:638:54)
    at ku (/home/tom/ionide-vscode-fsharp/release/webpack:/src/Components/InfoPanel.fs:200:13)
    at /home/tom/ionide-vscode-fsharp/release/webpack:/src/Components/InfoPanel.fs:284:25
    at Object.then (/home/tom/ionide-vscode-fsharp/release/webpack:/Promise.fs:624:21)
    at u (/home/tom/ionide-vscode-fsharp/release/webpack:/Promise.fs:638:54)
    at Nu (/home/tom/ionide-vscode-fsharp/release/webpack:/src/Components/InfoPanel.fs:252:9)
    at Iu (/home/tom/ionide-vscode-fsharp/release/webpack:/src/Components/InfoPanel.fs:373:13)
    at /home/tom/ionide-vscode-fsharp/release/webpack:/src/fsharp.fs:89:33
    at r (/home/tom/ionide-vscode-fsharp/release/webpack:/src/fsharp.fs:30:17)
    at /home/tom/ionide-vscode-fsharp/release/webpack:/src/fsharp.fs:89:13
    at g._activate (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8154)
    at g._waitForDepsThenActivate (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8096)
    at g._initialize (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:7460)
[LineLens] Config Changed event
[LineLens] Config Changed event
[PipelineHints] Config Changed event
[PipelineHints] Config Changed event

tomboland avatar May 03 '22 21:05 tomboland

I have the same issue when opening an F# project in WSL 2, using the most recent Ionide version. In my WSL, I am running Ubuntu 22.04 and .NET 6.0.5.

d4span avatar May 15 '22 15:05 d4span

Same for me, WSL2 ubuntu 20.04, dotnet 6.0.101. The first error I got was dotnet could not be found (altough it is in PATH) and then I set "FSharp.dotnetRoot": "/usr/bin/dotnet" and got still loading in status bar and the "n is not a function" message.

jonaskello avatar Jun 06 '22 12:06 jonaskello

I encountered the same issue. Same story as jonaskello.

Jlll1 avatar Jun 30 '22 14:06 Jlll1

I've had this bug for a long time and it turned out that I had a bug in my settings. The "FSharp: Dotnet Root" was set to /usr/local/share/dotnet/dotnet (i.e including the binary). When I removed it, or changed it to /usr/local/share/dotnet/ then the bug i.e n is not a function disappeared.

dbrattli avatar Jul 01 '22 08:07 dbrattli

@dbrattli I tried both. Pointing directly at the binary causes the n is not a function message, but pointing it to the root directory causes Ionide to fail to load, because it can't find the sdk for some reason.

Jlll1 avatar Jul 02 '22 04:07 Jlll1

I already have the path /usr/share/dotnet set, and the binary is /usr/share/dotnet/dotnet. Ionide still complains with the same error. I'm just using the "F# Language Server updated" extension now. Shame.

tomboland avatar Jul 06 '22 13:07 tomboland

sorry folks - things are languishing a bit due to personal circumstances. if anyone wants to build + run the extension locally and try to reproduce or get a stack trace that could help a lot in narrowing down the root cause.

baronfel avatar Jul 06 '22 13:07 baronfel

Hi @baronfel .

Do you need more than this? https://github.com/ionide/ionide-vscode-fsharp/issues/1697#issuecomment-1116681813

tomboland avatar Jul 06 '22 13:07 tomboland

@baronfel given some guidance, I'm happy to try and resolve this. It's a completely alien codebase though, and I'm not even all that knowledgeable when it comes to the dependencies. Give me some good directions though, and I'm probably capable of getting to the bottom of it.

tomboland avatar Jul 06 '22 13:07 tomboland

it looks like the root cause of the OP was not finding the dotnet binary to run, and that's just silly because the binary should be argv[0] for any FSAC instance (because we don't bundle the 'apphost' for FSAC). it should be easy enough to fix on the FSAC codebase, but I'm running into issue with FAKE now :-/

baronfel avatar Jul 06 '22 13:07 baronfel

Exact same issue for me. And stems from not finding the dotnet installation.

Setting dotnet root to /usr/share/dotnet seems to work, though should not be necessary given regular apt install and

(base) jovyan@Mikael-Surface:~/work/FsAlgo/FsAlgoLib$ whereis dotnet
dotnet: /usr/bin/dotnet /usr/share/dotnet
(base) jovyan@Mikael-Surface:~/work/FsAlgo/FsAlgoLib$ ls -la /usr/bin/dotnet
lrwxrwxrwx 1 root root 22 Jun 22 11:18 /usr/bin/dotnet -> ../share/dotnet/dotnet

I'm using ubuntu:20.04 container on WSL2.

MikaelUmaN avatar Jul 23 '22 16:07 MikaelUmaN

interesting - I know we've had problems with WSL before, I wonder if that's causing any problems...

the next release should do better all around though - FSAC should pick up the dotnet that it's spawned with, and Ionide itself has better/more detailed/more consistent error messages that guide the user to configuring the dotnet path.

baronfel avatar Jul 23 '22 16:07 baronfel

I was having this exact same issue on macOS, albeit not really sure if it was because the dotnet executable could not be loaded. In my case I was having the same message, but the solution loaded correctly, just with no items in any of the projects I have inside (dependencies seemed to load correctly) and I did not get any error messages anywhere.

I was able to fix it by removing a bunch of versions of the SDK that I had lying around. This was the output of the dotnet uninstall list before removing (when it was not working):

~/dotnet-core-uninstall 4.2s λ ./dotnet-core-uninstall list

This tool cannot uninstall versions of the runtime or SDK that are installed using zip/scripts. The versions that can be uninstalled with this tool are:

.NET Core SDKs:
  6.0.400-preview.22330.6  (arm64)  [Used by Visual Studio for Mac. Specify individually or use —-force to remove]
  6.0.203                  (arm64)
  6.0.201                  (arm64)
  3.1.421                  (x64)
  3.1.419                  (x64)

.NET Core Runtimes:
  6.0.6  (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]
  6.0.6  (x64)
  6.0.5  (arm64)
  6.0.5  (x64)
  6.0.3  (arm64)
  6.0.3  (x64)

And after removing the preview one + a bunch of older ones:

~/dotnet-core-uninstall λ ./dotnet-core-uninstall list

This tool cannot uninstall versions of the runtime or SDK that are installed using zip/scripts. The versions that can be uninstalled with this tool are:

.NET Core SDKs:
  6.0.203  (arm64)  [Used by Visual Studio for Mac. Specify individually or use —-force to remove]

.NET Core Runtimes:
  6.0.6  (arm64)  [Used by Visual Studio for Mac or SDKs. Specify individually or use —-force to remove]
  6.0.6  (x64)

And now it seems to work magically. Don't know if it's just a coincidence or if it was really caused by any of these versions, but it did happen 100% before uninstalling them.

sleepyfran avatar Aug 08 '22 22:08 sleepyfran

@sleepyfran did you try final 6.0.400? Everything used to work fine for me before installation of new SDK. I also use macOS (m1 max) + vscode 1.70.0 + ionide 6.0.6 (as 7.0.0 causes all of my CPU cores to go to 100%)

draganjovanovic1 avatar Aug 12 '22 09:08 draganjovanovic1

It is definitely SDK 6.0.400 related issue. As soon as I removed it from the system and reverted to 6.0.302 ionide works like a charm again.

Setup:

  • Macbook Pro M1 Max
  • VS Code 1.70.0
  • Ionide: 6.0.6
  • dotnet SDK 6.0.302

draganjovanovic1 avatar Aug 12 '22 12:08 draganjovanovic1

Yes, we've had numerous reports about the 6.0.4xx previews, as well as the 7.0.1xx previews. Just haven't had time to figure out what's going on.

I'll add a pinned issue to this repo saying that we're having issues with them in the meantime, hopefully that will help folks save some troubleshooting time.

baronfel avatar Aug 12 '22 12:08 baronfel

@baronfel obviously 6.0.400-preview issues now became 6.0.400 official release issues. Hope you will sort it out soon.

draganjovanovic1 avatar Aug 12 '22 12:08 draganjovanovic1

Yes, we've had numerous reports about the 6.0.4xx previews, as well as the 7.0.1xx previews. Just haven't had time to figure out what's going on.

I'll add a pinned issue to this repo saying that we're having issues with them in the meantime, hopefully that will help folks save some troubleshooting time.

Thanks for the clarification! Any pointers on where to start looking if I were to compile the extension locally to investigate? Would love to help with the investigation 😄

sleepyfran avatar Aug 12 '22 17:08 sleepyfran

Hitting the same problem with dev containers. The problem is with dev containers you can't pick a different SDK than 400 at the moment.

OnurGumus avatar Aug 26 '22 06:08 OnurGumus

Please resolve this issue.

ken-okabe avatar Jun 27 '23 23:06 ken-okabe

@ken-okabe what kinds of errors are you seeing? can your provide any logs from the F# output panel, and/or logs from project loading (via right-click, show project details)?

baronfel avatar Jul 02 '23 16:07 baronfel

Reading your comment, I have confirmed the existence of the F# output panel. In fact, I tried to identify the cause of this c issue myself, but it has been totally random. Next time the project fails to load, I will let you know the contents of the error. Thank you.

ken-okabe avatar Jul 02 '23 18:07 ken-okabe

If you were using .net 8 previews and experiencing this issue, the newly-released 7.7.1 version of Ionide should resolve it.

baronfel avatar Jul 02 '23 18:07 baronfel

@ken-okabe what kinds of errors are you seeing? can your provide any logs from the F# output panel, and/or logs from project loading (via right-click, show project details)?

I have the error now.

Ionide for F# v7.7.1

I manage .net version control with symlink.

  1. Download the latest .net binary from https://dotnet.microsoft.com/en-us/download/dotnet/7.0 https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.306-linux-x64-binaries

  2. Unarchive and place in some directory

image

  1. Create new project directory, and place the symlink to the .net sdk directory

image

  1. Confirm dotnet command works

image

  1. Create new F# console project

image

  1. Launch a VSCode profile that already works with other F# projects

code-insiders --profile fsharp ./

image

  1. Could not find dotnet;

The VSCode built-in terminal has the working dotnet path, just Ionide extension complains

image

image

image

My request:

I want this extension to make sure to use the identical context of the shell as the one the VSCode built-in terminal uses.

Note:

I am writing a book about functional programming using TypeScript and F#.

For TypeScript, the environment is stable, and I could write How to start TypeScript in VSCode, however, for F#, since the Ionide setup has been pretty unstable, I always have trouble to write How to start F# in VSCode, and I feel sorry for the unstability of F# setup that would blocks the beginner to join F# world.

ken-okabe avatar Jul 21 '23 23:07 ken-okabe

@ken-okabe did you set the DOTNET_ROOT environment variable when setting up your custom execution environment? That's documented as required in the manual installation instructions for .Net, and we have logic to look for that value if set.

baronfel avatar Jul 21 '23 23:07 baronfel

DOTNET_ROOT

Thanks, actually, I recognize that, but the point is I need .net version control.

Multiple versions of .net SDK coexist side by side, and the global environment variables obviously does not fit the purpose.

The document is for beginners not knowing what they are doing.

For the purpose of running the local .net version, I do alias dotnet=.net/dotnet in .zshrc.

The point is, sometimes this method works in some F# project, but not always.

If a user properly configured the global environment variables, dotnet command of their shell context works anyway. Why does the extension have to look the value when the shell context works?

The bottom line is this should not happen:

image

The VSCode built-in terminal recognizes dotnet path in the working context, but the extension does not.

ken-okabe avatar Jul 21 '23 23:07 ken-okabe