Closed arunchndr closed 2 months ago
Hi, any fix for the issue? This keeps happening randomly. Currently I have been able to minimize the error by downgrading ms-dotnettools.csharp to v2.3.27 and dev kit to latest version. But still in random scenarios it keeps happening.
@shv07 can you please post the full contents of the C# output window (with dotnet.server.trace
set to `Trace in vscode settings)? It looks like the language server isn't getting the project info.
The restart issue is known, instead of restarting the language server I recommend reloading the window.
Thanks for the recommendation on reloading the window @dibarbet. Please find below the C# output window when one of the error occurs (this error gets fixed on reloading the window, can't say for sure that this is the only kind of log obtained when Go To Definition
does not work).
[LanguageServerHost] PublicWorkspacePullDiagnosticsHandler(category: , source: ) started getting diagnostics
[LanguageServerHost] previousResults.Length=0
[LanguageServerHost] Processing 0 documents
[LanguageServerHost] Found 980 diagnostics for DocumentDiagnosticSource: /workspaces/Xyz/Data/Data.Assessment/Repositories/TestRepository.cs in Xyz.Data.Assessment
[LanguageServerHost] Microsoft.CodeAnalysis.LanguageServer.Handler.Diagnostics.Public.PublicDocumentPullDiagnosticsHandler finished getting diagnostics
[LanguageServerHost] [11:12:21.189][End]textDocument/diagnostic
[LanguageServerHost] /workspaces/Xyz/Abc/Supervisor/AssessmentSupervisor.cs found in workspace Host
[LanguageServerHost] [11:12:24.781][Start]textDocument/hover
[LanguageServerHost] [11:12:24.804][End]textDocument/hover
[LanguageServerHost] /workspaces/Xyz/Abc/Supervisor/AssessmentSupervisor.cs found in workspace Host
[LanguageServerHost] [11:12:25.122][Start]textDocument/hover
[LanguageServerHost] [11:12:25.147][End]textDocument/hover
[LanguageServerHost] /workspaces/Xyz/Abc/Supervisor/AssessmentSupervisor.cs found in workspace Host
[LanguageServerHost] [11:12:26.303][Start]textDocument/hover
[LanguageServerHost] [11:12:26.307][End]textDocument/hover
[LanguageServerHost] /workspaces/Xyz/Abc/Supervisor/AssessmentSupervisor.cs found in workspace Host
[LanguageServerHost] [11:12:27.395][Start]textDocument/hover
[LanguageServerHost] [11:12:27.400][End]textDocument/hover
[LanguageServerHost] /workspaces/Xyz/Abc/Supervisor/AssessmentSupervisor.cs found in workspace Host
[LanguageServerHost] [11:13:31.606][Start]textDocument/hover
[LanguageServerHost] [11:13:31.613][End]textDocument/hover
[LanguageServerHost] /workspaces/Xyz/Abc/Supervisor/AssessmentSupervisor.cs found in workspace Host
[LanguageServerHost] [11:13:33.976][Start]textDocument/inlayHint
[LanguageServerHost] [11:13:33.976][End]textDocument/inlayHint
[Error - 11:13:35 AM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.
[Error - 11:13:35 AM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.
[Error - 11:13:35 AM] Stopping server failed
Message: Cannot call write after a stream was destroyed
Code: -32099
[Error - 11:13:35 AM] Stopping server failed
Message: Cannot call write after a stream was destroyed
Code: -32099
[Error - 11:13:35 AM] Stopping server failed
Message: Cannot call write after a stream was destroyed
Code: -32099
Language server process exited with 143
Apologies for the delay here. Looks like the language server is crashing, though not much more info on why. Can you try setting dotnet.server.crashDumpPath
in your VSCode settings to user writeable directory? That should collect a dump when the server crashes which you can send to me (my microsoft email is in my profile).
Thanks!
Hi, I could not find the option you mentioned in vscode. But below is a part of another error logs which my team got for the same error. (Some filepaths may have been starred)
[LanguageServerHost] /workspaces/Ac**/Dom**/Ac**.Do**/Sup/Ques.cs found in workspace Host
[LanguageServerHost] [05:49:22.776][Start]textDocument/codeAction
[LanguageServerHost] [05:49:22.979][End]textDocument/codeAction
[Info - 5:49:24 AM] Connection to server got closed. Server will restart.
true
Language server process exited with 143
Using dotnet configured on PATH
Dotnet path: /usr/share/dotnet/dotnet
Activating C# + C# Dev Kit...
Starting server at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.LanguageServer.dll
Server arguments /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.LanguageServer.dll --logLevel Trace --sharedDependencies /home/vscode/.vscode-remote/extensions/ms-dotnettools.csdevkit-1.6.8-linux-x64/components/vs-green-server/platforms/linux-x64/node_modules/@microsoft/visualstudio-server-shared.linux-x64 --extension /home/vscode/.vscode-remote/extensions/ms-dotnettools.csdevkit-1.6.8-linux-x64/components/roslyn-visualstudio-languageservices-devkit/node_modules/@microsoft/visualstudio-languageservices-devkit/Microsoft.VisualStudio.LanguageServices.DevKit.dll --sessionId 38e05330-d3a9-424e-aa95-04c40e63fb981717475222297 --telemetryLevel all --extensionLogDirectory /home/vscode/.vscode-remote/data/logs/20240604T042712/exthost1/ms-dotnettools.csharp
waiting for named pipe information from server...
[stdout] dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.dll added to workspace.
[stdout] dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Scripting.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Workspaces.MSBuild.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.CSharp.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Remote.Workspaces.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.AnalyzerUtilities.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Workspaces.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Features.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Razor.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.CSharp.Features.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.Elfie.dll added to workspace.
dbug: LanguageServerWorkspaceFactory[0]
Solution-level analyzer at /home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.3.27-linux-x64/.roslyn/Microsoft.CodeAnalysis.CSharp.Workspaces.dll added to workspace.
[stdout] {"pipeName":"/tmp/13516f6c-465c-46f1-9530-6daaa7ca5d09.sock"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info - 5:49:26 AM] [Program] Language server initialized
[LanguageServerHost] [05:49:26.734][Start]initialize
[LanguageServerHost] [05:49:26.741][Start]Initialize
[LanguageServerHost] [05:49:26.848][End]Initialize
[LanguageServerHost] [05:49:26.900][End]initialize
[LanguageServerHost] [05:49:26.911][Start]initialized
[LanguageServerHost] [05:49:27.028][End]initialized
[LanguageServerHost] [05:49:27.030][Start]serviceBroker/connect
[LanguageServerHost] [05:49:27.030][Start]textDocument/didOpen
[LanguageServerHost] didOpen for file:///workspaces/Ac**/UnitTests/Ac**UnitTesting/DraftUT.cs
[LanguageServerHost] [05:49:27.039][End]textDocument/didOpen
[LanguageServerHost] [05:49:27.040][Start]textDocument/didOpen
[LanguageServerHost] didOpen for file:///workspaces/Ac**/Services/Ac**Api/Controllers/Draft**er.cs
[LanguageServerHost] [05:49:27.041][End]textDocument/didOpen
[LanguageServerHost] [05:49:27.041][Start]textDocument/didOpen
[LanguageServerHost] didOpen for file:///workspaces/Ac**/Do**/Ac**.Do**/Supervisor/Question.cs
[LanguageServerHost] [05:49:27.041][End]textDocument/didOpen
[BrokeredServiceTraceListener] ServiceBroker Information: 1 :
[BrokeredServiceTraceListener] SameProcess proffered brokered service(s): Microsoft.VisualStudio.RemoteBrokeredServiceManifest (0.2).
[BrokeredServiceTraceListener] ServiceBroker Information: 1 :
[BrokeredServiceTraceListener] SameProcess proffered brokered service(s): Microsoft.VisualStudio.GlobalBrokeredServiceContainer.MissingServiceDiagnostics (1.0).
[BrokeredServiceTraceListener] ServiceBroker Information: 1 :
[BrokeredServiceTraceListener] SameProcess proffered brokered service(s): Microsoft.ServiceHub.Framework.AuthorizationService.
[LanguageServerHost] Could not find 'file:///workspaces/Ac**/UnitTests/Ac**.ServicesUnitTesting/DraftUT.cs'. Searched Host
[BrokeredServiceTraceListener] ServiceBroker Information: 1 :
[BrokeredServiceTraceListener] SameProcess proffered brokered service(s): Microsoft.VisualStudio.LanguageServices.WorkspaceProjectFactoryService, Microsoft.CodeAnalysis.LanguageServer.IHelloWorld (0.1), Microsoft.CodeAnalysis.LanguageServer.ManagedHotReloadLanguageService (0.1), Microsoft.VisualStudio.Server.IBrokeredServiceBridgeManifest (0.1).
[Microsoft.CodeAnalysis.LanguageServer.BrokeredServices.BrokeredServiceBridgeProvider] Setting up brokered service bridge
[BrokeredServiceTraceListener] ServiceBroker Start: 0 :
[BrokeredServiceTraceListener] Requesting proxy to "helloServiceHubDotNetHost (0.1)"
[BrokeredServiceTraceListener] ServiceBroker Warning: 3 :
[BrokeredServiceTraceListener] Brokered service "helloServiceHubDotNetHost (0.1)" has no proffering source and no package registered to load.
[BrokeredServiceTraceListener] ServiceBroker Warning: 2 :
[BrokeredServiceTraceListener] Request for proxy to "helloServiceHubDotNetHost (0.1)" is declined: ServiceFactoryNotProffered.
[BrokeredServiceTraceListener] ServiceBroker Stop: 0 :
[BrokeredServiceTraceListener] Requesting proxy to "helloServiceHubDotNetHost (0.1)"
[LanguageServerHost] [05:49:27.148][Start]textDocument/diagnostic
[LanguageServerHost] PublicDocumentPullDiagnosticsHandler(category: , source: ) started getting diagnostics
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "handshake" -> Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.HandshakeAsync(ServiceBrokerClientMetadata, CancellationToken) (Microsoft.ServiceHub.Framework.IpcRelayServiceBroker)
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "requestServiceChannel" -> Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.RequestServiceChannelAsync(ServiceMoniker, ServiceActivationOptions, CancellationToken) (Microsoft.ServiceHub.Framework.IpcRelayServiceBroker)
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "cancelServiceRequest" -> Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.CancelServiceRequestAsync(Guid) (Microsoft.ServiceHub.Framework.IpcRelayServiceBroker)
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "dispose" -> Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.Dispose() (Microsoft.ServiceHub.Framework.IpcRelayServiceBroker)
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "handshake" -> Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.HandshakeAsync(ServiceBrokerClientMetadata, CancellationToken) (Microsoft.ServiceHub.Framework.IpcRelayServiceBroker)
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "requestServiceChannel" -> Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.RequestServiceChannelAsync(ServiceMoniker, ServiceActivationOptions, CancellationToken) (Microsoft.ServiceHub.Framework.IpcRelayServiceBroker)
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "cancelServiceRequest" -> Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.CancelServiceRequestAsync(Guid) (Microsoft.ServiceHub.Framework.IpcRelayServiceBroker)
[BrokeredServiceTraceListener] ServiceBroker Information: 2 :
[BrokeredServiceTraceListener] Listening for events from Microsoft.ServiceHub.Framework.IpcRelayServiceBroker.AvailabilityChanged to raise notification.
[BrokeredServiceTraceListener] ServiceBroker Information: 3 :
[BrokeredServiceTraceListener] Listening started.
[LanguageServerHost] previousResults.Length=0
[LanguageServerHost] Processing 1 documents
[BrokeredServiceTraceListener] ServiceBroker Information: 7 :
[BrokeredServiceTraceListener] {"id":2,"method":"handshake"}
[BrokeredServiceTraceListener] ServiceBroker Verbose: 7 :
[BrokeredServiceTraceListener] Received: {"jsonrpc":"2.0","id":2,"method":"handshake","params":[{"supportedConnections":"IpcPipe","localServiceHost":{"operatingSystem":1,"processArchitecture":1,"runtime":2,"runtimeVersion":"8.0.3"}}]}
[BrokeredServiceTraceListener] ServiceBroker Information: 6 :
[BrokeredServiceTraceListener] Received request "2" for method "handshake".
[LanguageServerHost] Could not find 'file:///workspaces/Ac**/Services/Ac**.Api/Controllers/DraftController.cs'. Searched Host;MiscellaneousFiles
[LanguageServerHost] [05:49:27.197][Start]textDocument/diagnostic
[LanguageServerHost] PublicDocumentPullDiagnosticsHandler(category: , source: ) started getting diagnostics
[LanguageServerHost] previousResults.Length=0
[LanguageServerHost] Processing 1 documents
[LanguageServerHost] Could not find 'file:///workspaces/Ac**/DomainLogic/Ac**.DomainLogic/Supervisor/QuestSupervisor.cs'. Searched Host;MiscellaneousFiles
[LanguageServerHost] [05:49:27.201][Start]textDocument/diagnostic
[LanguageServerHost] PublicDocumentPullDiagnosticsHandler(category: , source: ) started getting diagnostics
[LanguageServerHost] previousResults.Length=0
[LanguageServerHost] Processing 1 documents
[LanguageServerHost] [05:49:27.210][Start]workspace/diagnostic
[BrokeredServiceTraceListener] ServiceBroker Information: 0 :
[BrokeredServiceTraceListener] Added local RPC method "availabilityChanged" -> _proxy_Microsoft.ServiceHub.Framework.IRemoteServiceBroker_fc90fea2-e3c8-4960-a154-920fca145793.OnAvailabilityChanged(BrokeredServicesChangedEventArgs) (_proxy_Microsoft.ServiceHub.Framework.IRemoteServiceBroker_fc90fea2-e3c8-4960-a154-920fca145793)
[BrokeredServiceTraceListener] ServiceBroker Information: 3 :
[BrokeredServiceTraceListener] Listening started.
[BrokeredServiceTraceListener] ServiceBroker Information: 1 :
[BrokeredServiceTraceListener] IRemoteServiceBroker proffered from remote source: OtherProcessOnSameMachine.
[LanguageServerHost] PublicWorkspacePullDiagnosticsHandler(category: , source: ) started getting diagnostics
[BrokeredServiceTraceListener] ServiceBroker Information: 1 :
[BrokeredServiceTraceListener] OtherProcessOnSameMachine proffered brokered service(s): Microsoft.CodeAnalysis.LanguageClient.SolutionSnapshotProvider (0.1), vs-intellicode-base-models (0.1), Microsoft.VisualStudio.ProjectSystem.ProjectInitializationStatusService (0.1), Microsoft.VisualStudio.Debugger.ManagedHotReloadService (0.1), helloServiceHubDotNetHost (0.1).
[BrokeredServiceTraceListener] ServiceBroker Information: 2 :
[BrokeredServiceTraceListener] Request for "helloServiceHubDotNetHost (0.1)" will be fulfilled by OtherProcessOnSameMachine
[LanguageServerHost] previousResults.Length=0
[LanguageServerHost] /workspaces/Ac**/DomainLogic/Ac**.DomainLogic/Supervisor/QuestSupervisor.cs found in workspace MiscellaneousFiles
[LanguageServerHost] /workspaces/Ac**/DomainLogic/Ac**.DomainLogic/Supervisor/QuestSupervisor.cs found in workspace MiscellaneousFiles
[BrokeredServiceTraceListener] ServiceBroker Start: 0 :
[LanguageServerHost] [05:49:27.223][Start]textDocument/documentSymbol
[LanguageServerHost] [05:49:27.225][Start]textDocument/codeAction
[LanguageServerHost] /workspaces/Ac**/DomainLogic/Ac**.DomainLogic/Supervisor/QuestSupervisor.cs found in workspace MiscellaneousFiles
This is the crash dump setting. Unfortunately there isn't any info in the logs telling us why its crashing, so we likely need a dump.
Closing - we need a crash dump for this to be actionable - if you're able to get one please re-open and tag me. Thanks!
From vscode-dotnettools created by shv07: microsoft/vscode-dotnettools#1031
Describe the Issue
I have c# dev kit installed with .Net 8.0 in vscode and am working on a dotnet webapp project. The Go to Definition just randomly does not work most of the times. The reference counts in such files is also coming as '0 references'.
At the same time, I am able to go to definition and see proper references in few other projects in the same solution.
The 'Solution Explorer' in the explorer window is coming correctly, and dotnet build, etc work correctly.
The output window shows the 'Projects' dropdown as well.
Sometimes, the affected file shows this log in 'C# Output window of vscode':
On trying to restart .Net Language server I get this error:-
Steps To Reproduce
Expected Behavior
No response
Environment Information