vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

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

Open CTJansson opened this issue 6 years ago • 41 comments
trafficstars

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.

CTJansson avatar Jan 27 '19 17:01 CTJansson

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

virtualdreams avatar Jan 28 '19 06:01 virtualdreams

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.

zalanlevai avatar Jan 28 '19 11:01 zalanlevai

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

NTaylorMullen avatar Jan 28 '19 15:01 NTaylorMullen

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.~~

CTJansson avatar Jan 28 '19 18:01 CTJansson

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

virtualdreams avatar Jan 29 '19 07:01 virtualdreams

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.

zalanlevai avatar Jan 29 '19 07:01 zalanlevai

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.

CTJansson avatar Jan 29 '19 17:01 CTJansson

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

jchand99 avatar Jan 29 '19 19:01 jchand99

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.

eduardomezencio avatar Feb 05 '19 02:02 eduardomezencio

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.

guytp avatar Feb 05 '19 18:02 guytp

@akshita31 shouldn't the payload verification catch this?

NTaylorMullen avatar Feb 05 '19 18:02 NTaylorMullen

@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?

gregg-miskelly avatar Feb 05 '19 18:02 gregg-miskelly

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

akshita31 avatar Feb 05 '19 18:02 akshita31

@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 avatar Feb 05 '19 18:02 NTaylorMullen

@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.

gregg-miskelly avatar Feb 05 '19 18:02 gregg-miskelly

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 avatar Feb 05 '19 19:02 NTaylorMullen

@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?

gregg-miskelly avatar Feb 05 '19 19:02 gregg-miskelly

(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.

NTaylorMullen avatar Feb 05 '19 19:02 NTaylorMullen

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 avatar Feb 06 '19 06:02 reke592

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

NTaylorMullen avatar Feb 06 '19 15:02 NTaylorMullen

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

jchand99 avatar Feb 07 '19 00:02 jchand99

@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 avatar Feb 07 '19 00:02 NTaylorMullen

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

jchand99 avatar Feb 07 '19 00:02 jchand99

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 avatar Feb 25 '19 19:02 xgnxs

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

gregg-miskelly avatar Feb 25 '19 19:02 gregg-miskelly

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

insidewhy avatar Feb 25 '19 21:02 insidewhy

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 avatar Apr 01 '19 23:04 djkiwe

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

akshita31 avatar Apr 02 '19 00:04 akshita31

@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 avatar Apr 02 '19 00:04 djkiwe

@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 😁.

NTaylorMullen avatar Apr 02 '19 01:04 NTaylorMullen