Could not start visual studio due to an error - StreamJsonRpc.ConnectionLostException

Dylan Baird 36 Reputation points
2021-03-13T20:55:55.207+00:00

Good afternoon,

I am primarily a Linux user but am excited by some of the GUI features of Visual Studio. Unfortunately I am unable to open Visual Studio. I downloaded the most recent installer and was able to install it without trouble. It will not open and throws the exception mentioned in the title.

The only other information is that it states "The JSON-RPC connection with the remote party was lost before the request could complete."

I'm not sure what connection it is trying to initiate and I have no idea how to go about debugging the IDE... Through the installer I tried repairing the installation which did not work. I then tried uninstalling and deleting all associated files, restarting the computer, then re installing. That did not work either.

I noticeon Github that there are similar issues but they are marked as resolved.

I'm not quite sure where to ask this (so I try here), and I am at a loss of what to do next.

I appreciate any assistance,

Dylan

Developer technologies | Visual Studio | Setup
Developer technologies | Visual Studio | Other
{count} votes

8 answers

Sort by: Most helpful
  1. Der Abt 1 Reputation point
    2021-07-12T11:30:16.073+00:00

    Same for me with VS 2019 10.3. It does not start at all.

    I tried EVERYTHING, including installing VS 2019 11.0 Preview -which also brings this error and does not start:
    "Visual Studio konnte aufgrund eines Fehlers nicht gestartet werden.
    StreamJsonRpc.ConnectionLostException:
    Die JSON-RPC-Verbindung mit der Gegenseite ging verloren, bevor die Anforderung abgeschlossen werden konnte."

    devenv /ResetSettings
    devenv /SafeMode
    devenv /Iforgotthisone
    ot starting as administrator
    did not fix it.

    • Repair Visual Studio
    • Install .Net 4.8 Development Components
    • Remove/Reinstall (later) All Addon Module
    • Uninstall Visual Studio and Reinstall it.
    • Install Version 11.0 Preview.
    • uninstalling everything and then run InstallCleanup.exe -f, redownload the online installer ands install just the .Net development as module: Brings the error during install.

    DID NOT HELP.
    So I never can get VS to run on my machine anymore unless I reinstall Windows, which I do not want to because of tons of software to reinstall/configure...

    Very annoying!


  2. haruki akimoto 1 Reputation point
    2021-10-31T21:55:07.613+00:00

    I find out forgetten comment out of last description. */
    This cause problem in my program.


  3. Lucas Harskamp 20 Reputation points
    2025-08-08T08:43:13.3133333+00:00

    I've had the same issue, here's a bandaid to the issue: it happens whenever an exception occurs in your own source generator and Microsoft's tooling doesn't gracefully catch it. You may think your source generator (or IIncrementalGenerator if that's your fancy) works fine, but unexpected errors may occur when it's working on a singular class in your assembly after you've saved its .cs file. So the best thing I could advise one is to wrap your SourceGenerator methods in try-catch blocks. This way, you'll be alerted when an issue does occur, so you can fix it.

    try
    {
    ...
    }
    catch (Exception ex)
    {
      Debugger.Launch();
      context.ReportDiagnostic(
    	Diagnostic.Create(
    		new DiagnosticDescriptor("GEN0001", "Source generator error", ex.Message, "SourceGen", DiagnosticSeverity.Error, true), 
    Location.None
    	));
    }
    

    Dear Microsoft; please provide a patch to Visual Studio where you presume any and all Source Generators will fail in unexpected ways, and account for that without it breaking the internal tools of the IDE.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.