Omnisharp dies when connecting to LiveShare session
See original GitHub issueEnvironment data
.NET Core SDK (reflecting any global.json): Version: 3.1.301 Commit: 7feb845744
Runtime Environment: OS Name: Mac OS X OS Version: 10.14 OS Platform: Darwin RID: osx.10.14-x64 Base Path: /usr/local/share/dotnet/sdk/3.1.301/
Host (useful for support): Version: 3.1.5 Commit: 65cd789777
.NET Core SDKs installed: 3.1.101 [/usr/local/share/dotnet/sdk] 3.1.200 [/usr/local/share/dotnet/sdk] 3.1.301 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.17 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
VS Code version: 1.47.0
C# Extension version: 1.22.1
OmniSharp log
[Client - 12:35:24 PM] Razor language server path: /Users/nromer/.vscode/extensions/ms-dotnettools.csharp-1.22.1/.razor/rzls
[Client - 12:35:33 PM] Starting Razor Language Server…
[Client - 12:35:33 PM] Server started, waiting for client to be ready…
[Info - 12:35:33 PM] Finding descriptor for initialize
[Info - 12:35:33 PM] Starting: Routing Request (0) initialize
[Info - 12:35:33 PM] Converting params for Request (0) initialize to OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams
[Error - 12:35:33 PM] Failed to handle notification initialize - System.ArgumentNullException: Value cannot be null. (Parameter ‘workspaceDirectory’)
at Microsoft.AspNetCore.Razor.LanguageServer.ProjectConfigurationFileChangeDetector.StartAsync(String workspaceDirectory, CancellationToken cancellationToken) in //src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectConfigurationFileChangeDetector.cs:line 50
at Microsoft.AspNetCore.Razor.LanguageServer.RazorFileChangeDetectorManager.InitializedAsync(ILanguageServer languageServer) in //src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorFileChangeDetectorManager.cs:line 42
at Microsoft.AspNetCore.Razor.LanguageServer.RazorLanguageServer.<>c__DisplayClass1_0.<<CreateAsync>b__3>d.MoveNext() in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs:line 53
— End of stack trace from previous location —
at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle(InitializeParams request, CancellationToken token)
at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)
at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)
at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate
1 next)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.RouteRequest(TDescriptor descriptor, Request request, CancellationToken token) [Info - 12:35:33 PM] Finished: Routing Request (0) initialize in 63ms [Error - 12:35:33 PM] Server initialization failed. Message: Internal Error - System.ArgumentNullException: Value cannot be null. (Parameter 'workspaceDirectory') at Microsoft.AspNetCore.Razor.LanguageServer.ProjectConfigurationFileChangeDetector.StartAsync(String workspaceDirectory, CancellationToken cancellationToken) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectConfigurationFileChangeDetector.cs:line 50 at Microsoft.AspNetCore.Razor.LanguageServer.RazorFileChangeDetectorManager.InitializedAsync(ILanguageServer languageServer) in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorFileChangeDetectorManager.cs:line 42 at Microsoft.AspNetCore.Razor.LanguageServer.RazorLanguageServer.<>c__DisplayClass1_0.<<CreateAsync>b__3>d.MoveNext() in /_/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs:line 53 --- End of stack trace from previous location --- at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle(InitializeParams request, CancellationToken token) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.JsonRpc.RequestRouterBase
1.RouteRequest(TDescriptor descriptor, Request request, CancellationToken token)
Code: -32602
[Info - 12:35:33 PM] Finding descriptor for shutdown
[Info - 12:35:33 PM] Starting: Routing Request (1) shutdown
[Info - 12:35:33 PM] Converting params for Request (1) shutdown to OmniSharp.Extensions.JsonRpc.EmptyRequest
[Info - 12:35:33 PM] Result was System.Runtime.CompilerServices.AsyncTaskMethodBuilder1+AsyncStateMachineBox
1[[MediatR.Unit, MediatR, Version=7.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2],[MediatR.Pipeline.RequestPreProcessorBehavior`2+<Handle>d__2[[OmniSharp.Extensions.JsonRpc.EmptyRequest, OmniSharp.Extensions.JsonRpc, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[MediatR.Unit, MediatR, Version=7.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2]], MediatR, Version=7.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2]]
[Info - 12:35:33 PM] Response value was (null)
[Info - 12:35:33 PM] Finished: Routing Request (1) shutdown in 13ms
Steps to reproduce
Connect to a LiveShare session hosted on VS 2019 (Windows).
Expected behavior
OmniSharp shouldn’t die.
Actual behavior
Omnisharp dies immediately. The LiveShare session still works (I can view and edit code in it), but OmniSharp doesn’t.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
In LiveShare scenarios we shouldn’t try to start OmniSharp at all because it won’t have access to the files. All language server responsibilities (limited to those that LiveShare knows about) are handled on the “server”.
Ah, so even without Razor involved (
razor.disabled: true
) you have issues from the C# perspective. If that’s the case then @cartermp you may need to re-triage. We know we have some Razor issues in LiveShare in VSCode and are tracking that here: https://github.com/dotnet/aspnetcore/issues/14294 C# issues would need to be handled from the omnisharp-roslyn layer