Visual Studio code F# won't run - "Starting client failed"

Viewed 1484

I cannot for the life of me get F# to run in Visual Studio Code. I've had it up and running previously, but not with the most recent versions of the software.

I installed the most recent versions of .NET and VS code a month ago and again now, did full deletes and re-installs both times (including deleting user/.vscode and roaming/Code manually), but the error persists.

I am on a Windows 10 and have installed x64 versions of .NET Core 3.1 and VS Code 1.48 with the only extensions C# 1.23 and Ionide-fsharp 4.16. I have enabled Use Sdk Scripts for ionide, but otherwise run on default configuration. dotnet fsi is executed without problems in the command line.

Looking at the VSC extension host log:

[2020-08-15 11:24:35.431] [exthost] [error] Error: Language client is not ready yet
    at LanguageClient.sendRequest (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:7887:19)
    at __exports.compilerLocation (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4290:19)
    at fsacConfig (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4730:12)
    at c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4797:20
    at Object.__exports.msbuild (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:4802:10)
    at activate (c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:19152:91)
    at c:\Users\Bruger\.vscode\extensions\ionide.ionide-fsharp-4.16.0\fsharp.js:25116:90

which I believe is caused by this problem seen in the VSC F# log:

[Error - 11.24.35] Starting client failed
Launching server using command Invalid macro definition. failed.

I'm stuck here as I don't know what macro definition this refers to or how to get more information about the failure.

1 Answers

I just found the cause and solution for the problem. It had nothing to do with Ionide or Visual Studio Code. Instead my cmd was acting up due to misconfiguration.

For a while the message "Invalid macro definition" has been output as the first thing when I open cmd, but I didn't see the connection to the problem above. Turns out that VS code did not like this output and that it was the AutoRun configuration for cmd that triggered this error.

Using regedit, I found that I had several AutoRun files that were no good, so I removed them from respectively Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor and Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor and the problem was solved.

Related