dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 672 forks source link

Razor Service crashing #4152

Open jtsom opened 4 years ago

jtsom commented 4 years ago

Issue Type: Bug

Opening a Blazor WASM application causes the Razor service to crash and shut down.

crash log:

--------------------------------------------------------------------------------
Razor.VSCode version 6.0.0-alpha.1.20521.3
--------------------------------------------------------------------------------
Razor's trace level is currently set to 'Off'
 - To change Razor's trace level set 'razor.trace' to 'Off', 'Messages' or 'Verbose' and then restart VSCode.
 - To report issues invoke the 'Report a Razor issue' command via the command palette.
-----------------------------------------------------------------------------------------------------------------------------

Unhandled exception. OmniSharp.Extensions.JsonRpc.Server.MethodNotSupportedException: Method not found: 'razor/serverReady'.
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.Returning[TResponse](CancellationToken cancellationToken)
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.ReturningVoid(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Razor.LanguageServer.RazorServerReadyPublisher.ProjectSnapshotManager_Changed(Object sender, ProjectChangeEventArgs args) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorServerReadyPublisher.cs:line 63
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[Info  - 8:04:35 AM] Connection to server got closed. Server will restart.
Unhandled exception. OmniSharp.Extensions.JsonRpc.Server.MethodNotSupportedException: Method not found: 'razor/serverReady'.
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.Returning[TResponse](CancellationToken cancellationToken)
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.ReturningVoid(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Razor.LanguageServer.RazorServerReadyPublisher.ProjectSnapshotManager_Changed(Object sender, ProjectChangeEventArgs args) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorServerReadyPublisher.cs:line 63
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[Info  - 8:04:37 AM] Connection to server got closed. Server will restart.
Unhandled exception. OmniSharp.Extensions.JsonRpc.Server.MethodNotSupportedException: Method not found: 'razor/serverReady'.
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.Returning[TResponse](CancellationToken cancellationToken)
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.ReturningVoid(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Razor.LanguageServer.RazorServerReadyPublisher.ProjectSnapshotManager_Changed(Object sender, ProjectChangeEventArgs args) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorServerReadyPublisher.cs:line 63
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[Info  - 8:04:39 AM] Connection to server got closed. Server will restart.
Unhandled exception. OmniSharp.Extensions.JsonRpc.Server.MethodNotSupportedException: Method not found: 'razor/serverReady'.
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.Returning[TResponse](CancellationToken cancellationToken)
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.ReturningVoid(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Razor.LanguageServer.RazorServerReadyPublisher.ProjectSnapshotManager_Changed(Object sender, ProjectChangeEventArgs args) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorServerReadyPublisher.cs:line 63
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[Info  - 8:04:41 AM] Connection to server got closed. Server will restart.
Unhandled exception. OmniSharp.Extensions.JsonRpc.Server.MethodNotSupportedException: Method not found: 'razor/serverReady'.
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.Returning[TResponse](CancellationToken cancellationToken)
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.ReturningVoid(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Razor.LanguageServer.RazorServerReadyPublisher.ProjectSnapshotManager_Changed(Object sender, ProjectChangeEventArgs args) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorServerReadyPublisher.cs:line 63
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[Error - 8:04:43 AM] Connection to server got closed. Server will not be restarted.
[Client - 8:04:43 AM] (Error) Failed when activating Razor VSCode.
undefined
Stack Trace:
undefined

Extension version: 1.23.5 VS Code version: Code - Exploration 1.51.0-exploration (f5e2e8ba8af696d6a933903e28698d36831d3204, 2020-10-27T06:50:53.302Z) OS version: Darwin x64 19.6.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 2600)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|3, 3, 2| |Memory (System)|32.00GB (8.23GB free)| |Process Argv|-psn_0_6415902| |Screen Reader|no| |VM|18%|
jtsom commented 4 years ago

Additionally, trying to use the requests "Razor - Report Issue" does not work, results in an error message:

image

JoeRobich commented 4 years ago

@NTaylorMullen Does this seem to be an installation issue?

TanayParikh commented 4 years ago

Thanks, just hit this as well. Could we move this over to dotnet/aspnetcore please?

TanayParikh commented 4 years ago

Additionally, trying to use the requests "Razor - Report Issue" does not work, results in an error message:

Was this after the initial failure? If so, this is likely because the razor service is required to be able to report an issue. Will double check once that's resolved.

JoeRobich commented 4 years ago

Could we move this over to dotnet/aspnetcore please?

I am not sure that GH supports moving issues between organizations.

TanayParikh commented 4 years ago

Created: https://github.com/dotnet/aspnetcore/issues/27257 to track the issue there :)

ryanbrandenburg commented 3 years ago

Resolved, pending release.

tvardero commented 2 years ago

Still happens with C# extension v1.24.0 and .NET v6.0.101. Working in VSCode 1.64.2. Pastebin with verbose trace level: https://pastebin.com/DeQwMMvm

Just openning any .cshtml file makes razor language server die >5 times in less than 10 seconds.

Hit me if you need my project code (study project in asp.net mvc with .net 6)

JoeRobich commented 2 years ago

@tvardero You may want to look for an open issue in the razor repo - https://github.com/dotnet/razor-tooling/issues.