vscode-csharp: Arch: Razor Language Server server is crashing on startup of VS Code

Work around

  • Open the VS Code settings file (File menu->Preferences->Settings)
  • Add "razor.disabled": true

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.102
 Commit:    96ff75a873

Runtime Environment:
 OS Name:     antergos
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.2.102/

Host (useful for support):
  Version: 2.2.1
  Commit:  878dd11e62

.NET Core SDKs installed:
  2.2.102 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.1 [/opt/dotnet/shared/Microsoft.NETCore.App]

VS Code version:

Version: 1.30.2
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-08T23:10:56.746Z
Electron: 2.0.16
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Linux x64 4.20.4-arch1-1-ARCH

C# Extension version: 1.17.1

Steps to reproduce

  1. Have the C# extension installed
  2. Open up a random project, even a console app will do, that’s what I did
  3. Close down VS Code, and then launch it again and the error message should appear in the bottom right
  4. Close down VS Code, Reboot computer, start vs code and an error message should appear in the bottom right

Expected behavior

Not to crash I believe

Actual behavior

The Razor Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

[Info  - 6:06:01 PM] Connection to server got closed. Server will restart.
[Info  - 6:06:01 PM] Connection to server got closed. Server will restart.
[Info  - 6:06:02 PM] Connection to server got closed. Server will restart.
[Info  - 6:06:03 PM] Connection to server got closed. Server will restart.
[Error - 6:06:04 PM] Connection to server got closed. Server will not be restarted.

Also breaking the whole code application it seems, the debugger just sits there and doing nothing if you press F5, but I do have a problem with the debugger in a seperate issue.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 22
  • Comments: 40 (17 by maintainers)

Most upvoted comments

Deleting the extension from .vscode and reinstall has worked for me.

Can confirm this appeared again after a reboot, and as previously mentioned will be fixed by doing what @virtualdreams described. So this issue affects both AUR package and the one from arch-repo.

Completely disabling razor isn’t exactly a workaround, unless you don’t need razor.

I also have the same problem on Arch, but it happens even when I try to debug a Python project, if I have the C# extension installed. For some reason, it unnecessarily loads the Razor Language Server when running unrelated code. Removing the C# extension solves it and enables me to run Python code again.

@WatchDogsDev Since this issue is so old, It would be good to open a new issue. Please provide the OmniSharp Log and Razor Log from the VS Code output pane, as well as the output of running dotnet --info from a terminal.

@reke592, you should be using razor.disabled not razor.devmode 😁

a reboot causes the problem to come back

Oooh, I didn’t catch that part of the issue. Yes I agree. A way users can work aroudn this for the interim is to set "razor.disabled": "true"

Another confirmation here. Issue reappears after reboot. Quickest solution for now is uninstall the extension in UI, rm -Rf the extension from disk, reload the UI, reinstall the extension as reported by others. This is using the visual-studio-code-bin package on Arch.