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

Created on 27 Jan 2019  路  38Comments  路  Source: OmniSharp/omnisharp-vscode

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.

Most helpful comment

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

All 38 comments

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

I've had the same behavior on Arch. What @virtualdreams mentioned worked for me as well, although not sure about the actual cause of the issue.

Hopefully this wont be an issue in the future because of @akshita31's extension download verification to ensure that everything installs correctly

uninstalling the C# extension and then remove the folder helped solving this issue. the referenced issue is still unsolved for me.
EDIT: This issue can be closed aswell, I was using the VS Code from arch repo and it seems broken somehow (code 1.30.2-1), I installed the AUR package instead and no more problems.

I have also VS Code from AUR, but the problem reappears after reboot. Need to remove the extension from folder and reinstall.

I don't think what @CTJansson mentioned about the Arch packages is actually related as I've had the issue appear on the official Microsoft build of Code from the get go.
On another note, the issue reappeared for me after a reboot but I was able to (for now) solve it by reapplying the previously mentioned fix.

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.

Doubly confirm issue still exists after reboot. Temporary fix is still uninstall extension from folder and re-install. Using visual-studio-code-bin package

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.

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.

@akshita31 shouldn't the payload verification catch this?

@NTaylorMullen I believe the problem is that the version of the Razor language service that we are shipping is still using the older CoreCLR. Does the latest beta have this problem fixed? What is the right work around for folks who don't need Razor but want C# features?

@NTaylorMullen The verification using checksum is in beta and not yet released.

@NTaylorMullen I believe the problem is that the version of the Razor language service that we are shipping is still using the older CoreCLR. Does the latest beta have this problem fixed? What is the right work around for folks who don't need Razor but want C# features?

I thought so at first but when people were saying they were reinstalling and everything was just working that ruled out that scenario.

@NTaylorMullen The verification using checksum is in beta and not yet released.

Ahh, that makes sense 馃憤

@NTaylorMullen the fact that somehow a reboot causes the problem to come back makes me think this isn't going to be solved by download verification.

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"

@NTaylorMullen I added what I think is a full description of what you just typed to the first few lines of this issue. Can you confirm? (NOTE: You said "true" but I am assuming it is a bool rather than a string, so it should be true. Correct?)

Also, is there a beta release that folks can try to see if this is addressed with just a newer CoreCLR?

(NOTE: You said "true" but I am assuming it is a bool rather than a string, so it should be true. Correct?)

Yes, correct.

Also, is there a beta release that folks can try to see if this is addressed with just a newer CoreCLR?

Not yet, if there ends up being enough need for users wanting Razor on arch Linux we can definitely work on one though.

I have the same issue on Arch, I set the razor.devmode : true, Idk what it means to operate in a mode that allows us to run a Razor dev environment ontop of a shipped omnisharp-vscode. but it works for me.

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

@NTaylorMullen Out of curiosity, what is the difference? Why should one be used above the other?

@jchand99, razor.disabled stops everything Razor. razor.devmode just stops the starting of the Razor Language Server and the Razor wire up to VSCode. It's all to enable https://github.com/aspnet/Razor.VSCode to ctrl + f5 VSCode and replace the shipped Razor experience with a development version.

@NTaylorMullen Ah, I understand now, thank you for the clarification!

Confirming this issue on manjaro as well (using aur/visual-studio-code-bin 1.31.1-1) . Works fine on fresh install of C# extension, but after reboot, "Razor language server crashed 5 times and will not be restarted". Easy workaround so far has been to delete the ms-vscode.csharp directory in ~/.vscode/extensions, then reinstall C# extension in the UI (although it is annoying to have to download everything).

@xgnxs There is a much better work around. See the very top of this issue.

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

I have this issue on Manjaro as well and I do need Razor so the existing workaround is not good for me.

VS Code
Version: 1.32.3
OS: Linux x64 4.19.32-1-MANJARO

C# Extension
Version: 1.18

@djkiwe Could you uninstall and reinstall the extension and see if the problem persists?

@akshita31 When reinstalling the problem disappears temporally, but it comes back once the machine is rebooted, sometimes even when just the VS Code window is reloaded.

@djkiwe so sorry for the inconvenience. Thankfully It's a known issue that will be fixed in our next release though! (mid to late April)

Honestly not quite sure why it goes away at all when reinstalling the extension. I'd imagine it'd be broken always 馃榿.

Awesome. Thanks a lot! :)

Just adding my experience here with the same issue, and I also need the Razor support. Issue returns after reboot.

VS Code
Version: 1.32.3
OS: Ubuntu 18.04.2 LTS

C# Extension
Version: 1.18.0

I also have this issue

_VS Code_
Version: 1.32.3
OS: Ubuntu 18.04.2 LTS

_C# Extension_
Version: 1.18.0

I am experiencing the same issue while running Linux Mint 18

VSCode 1.35.1
OS Linux x64 4.4.0-150-generic
ms-vscode.csharp = 1.20

@rledyard could you share the output of your Razor Log?

@NTaylorMullen - Sorry for the delay. I have attached a bug report with log dumps
VSCode_RazorServer_BugReport_2019-07-07.txt
.

"razor.disabled": true is not work around, it just disables option to view razor logs.

@Djordje121 "razor.disabled": true will prevent the Razor language server from booting at all. If you're still seeing crashes chances are it's another extension 馃槩

Was this page helpful?
0 / 5 - 0 ratings