5

I recently upgraded VS 2022 to the latest version and now I start seeing these warnings:

enter image description here

I am using version 17.4.0:

enter image description here

The stack traces look something like:

StreamJsonRpc.ConnectionLostException : The JSON-RPC connection with the remote party was lost before the request could complete. ---> System.OperationCanceledException : The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at async StreamJsonRpc.MessageHandlerBase.WriteAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async StreamJsonRpc.JsonRpc.SendAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async StreamJsonRpc.JsonRpc.InvokeCoreAsync(<Unknown Parameters>)
   --- End of inner exception stack trace ---
   at async StreamJsonRpc.JsonRpc.InvokeCoreAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.TryInvokeAsync[TService](<Unknown Parameters>)

Any ideas on fixing this? Never happened before.

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • 1
    Does it happen each time you open Visual Studio? If so, I would try a repair on Visual Studio (the installer has an option to do so). – Timothy G. Nov 14 '22 at 16:27
  • @TimothyG. It seems to happen when I begin a build process. – Andrew Truckle Nov 14 '22 at 18:29
  • 1
    Ok - I'd still start with a repair of Visual Studio. Someone also suggested [resetting settings](https://stackoverflow.com/a/67034666/6530134), so you could also try that. I saw a few logged issues on the Visual Studio Feedback forum that seem similar to this, so something could be bugged about this version of Visual Studio. I am using the Preview version (17.5.0 Preview 1) and have not seen this happen. – Timothy G. Nov 14 '22 at 18:39
  • 3
    I'm having the same issue since I upgraded to 17.4.0. It often happens after 30 to 60 minutes of having Visual Studio running. It seems to happen also when Visual Studio just runs in the background. Once such an error ocours in CodeAnalysis (ConnectionLostException), there's an endless bunch of these every few seconds. – Benjamin Freitag Nov 16 '22 at 13:08
  • 1
    @BenjaminFreitag Still does it in 17.4.1. See my link in comment to answer here. – Andrew Truckle Nov 16 '22 at 15:27
  • 2
    Same issue in 17.4.1 – Benjamin Freitag Nov 17 '22 at 13:28

5 Answers5

3

The issue is tracked at Feature 'x' is currently unavailable due to an internal error and affects Visual Studio 17.4.0 and 17.4.1.

2

17.4.2 seems to have fixed things. at least for me, I was only noticing it in my .net core app.

Dan Main
  • 37
  • 6
2

I was able to solve this problem using Visual Studio settings by navigating to Text Editor -> C# -> Advanced and disabling:

Run code analysis in a separate process (requires restart)

(I also unchecked its sub-setting "Run code analysis on latest .NET (requires restart)", for good measure.)

I got the idea from this ReSharper discussion:
https://youtrack.jetbrains.com/issue/RSRP-493691/VS-Feature-unavailable-due-to-an-internal-error

(This Visual Studio setting may help regardless of whether one uses ReSharper.)

Coder
  • 133
  • 7
1

Report these using the Report A Problem tool. The tool captures logs from the current VS session which may be helpful to the development team. If you can trigger/reproduce the issue reliably, using the recording functionality can also collect dumps and ETL traces to help the investigation.

Jimmy
  • 27,142
  • 5
  • 87
  • 100
  • I put it here: https://developercommunity.visualstudio.com/t/Task-list--Symbol-finder--Asset-synchr/10199226 But I have not provided them with the requested logs. – Andrew Truckle Nov 16 '22 at 15:26
1

Specifically it looks like this is a problem with the Roslyn compiler used by Visual Studio. For more information about Roslyn check here. Although not "compiling" the code, Roslyn provides information about the code, such as syntax for Intellisense.

Per this link there's a recent (as of November '22) issue with Roslyn and it appears that these symptoms are a result of this cause. That suggests it will be resolved as part of an upcoming Visual Studio update.

For me the issue is reported with operations on the StreamJsonRpc object. I could only speculate why Roslyn uses StreamJsonRpc.

I have this with Visual Studio 2022 Professional v17.4.1 and others have reported it with v17.4.0. I was unable to resolve it by repairing Visual Studio or resetting its settings.

It was important for my own work to note that it was not a problem with my code. That prevented me spending hours on debug and package updates.

** On 11/29/22 Microsoft released Visual Studio version 17.4.2. I downloaded and installed it and I haven't seen these yellow warnings yet. I don't see Roslyn called out in the Microsoft release notes but the Roslyn issue referenced at the above URL was "Closed" today 11/30/22.

** On 12/2/22 I see the messages again so this cause is not resolved by the release of 17.4.3, at least for me.

brit503
  • 43
  • 7