question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Omnisharp dies when connecting to LiveShare session

See original GitHub issue

Environment 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, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 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.ResolveCommandPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.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+AsyncStateMachineBox1[[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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JoeRobichcommented, Sep 4, 2020

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

1reaction
NTaylorMullencommented, Sep 3, 2020

@NTaylorMullen I suppose particularly my issue is not intellisense itself. Intellisense is working, but there is no referential integrity.

I cannot click and navigate through references and implementations of things, as it seems there are no such symbols available to traverse.

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Visual Studio Live Share - Microsoft Learn
Troubleshooting tips and tricks for Visual Studio Live Share. ... Verify you are on a good network connection.
Read more >
Visual Studio Live Share is now available. : r/programming
"All connections in Visual Studio Live Share are SSH or SSL encrypted and ... guests (in addition to the host) in a Live...
Read more >
The Era of Visual Studio Code | Hacker News
I gave VSCode a solid go, and I had to keep installing plugin after plugin, but it was truly painful trying to find...
Read more >
Q - Visual Studio Blog - RSSing.com
Yet when developing IoT apps, you often need to manage connected devices and send ... Additionally, you can now create Visual Studio Live...
Read more >
build | Tim Anderson's IT Writing - ITWriting.com
Windows, let me emphasise, is neither dead nor dying. ... and the intelligent edge is all the computing devices that connect to it, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found