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

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,570 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
957 questions
{count} votes

7 answers

Sort by: Most helpful
  1. Markus Pope 16 Reputation points
    2021-05-05T23:40:38.513+00:00
    • Delete all of the logs in %userappdata%\temp\servicehub\logs. (This will be c:\users{your user}\appdata\local\temp\servicehub\logs most likely.)
    • Start Visual Studio and get the error message saying that JSON-RPC blah blah blah.
    • Open the log files generated in the servicehub\logs folder.
    • If you see an error indicating that System.Numerics.Vectors 4.1.3.0 could not be loaded because the version installed doesn't match the manifest, then go to the next step.
    • Modify the devenv.config file in the C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE folder (replace with appropriate folder for community or enterprise) and add the following assembly redirect:

    <dependentAssembly>
    <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
    </dependentAssembly>

    • Modify the Microsoft.Developer.IdentityService.dll.config file in C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\ServiceHub\Services\Microsoft.Developer.IdentityService (again replacing professional with community or enterprise) and add the same assembly redirect.

    <dependentAssembly>
    <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
    </dependentAssembly>

    After I did this, I was able to start Visual Studio Professional. >:( There appears to be some weird conversation going on about the versioning on this specific file dating back a couple of years and apparently no one is willing to address the problem.

    2 people found this answer helpful.

  2. Sandro Ribeiro 6 Reputation points
    2021-04-18T06:42:01.06+00:00

    I have the same problem.
    I use Visual Studio Community 16.9.4.
    I can't start the IDE.

    1 person found this answer helpful.
    0 comments No comments

  3. 2021-04-26T14:47:11.673+00:00

    I am having the same issue. Last week I upgraded to 16.9.4.
    In the mean time I uninstalled it via the installer and installcleanup tool. What remained at C:\Program Files (x86)\Microsoft visual studio and on c:\users\xxx\AppData\Local\Microsoft\VisualStudio I removed manually.
    I reinstalled 16.9.0 from https://learn.microsoft.com/en-us/visualstudio/releases/2019/history at the bottom of the page and still have same issue.
    I check with fuslogvw that there were not resolvable dll's and tried to copy some to the expected locations. But with no prevail.
    In the eventviewer I have the same as AlexandrBazarnyi-2400

    My windows 10 version: KERNELBASE.dll, version: 10.0.18362.1316
    I have .net framework 4.8 installed with release number 528040

    1 person found this answer helpful.
    0 comments No comments

  4. Alexandr Bazarnyi 1 Reputation point
    2021-04-22T23:24:35.61+00:00

    Same problem. Happened after update to 16.9.4.
    It does NOT start in a safe mode.

    However vs 2017 starts OK.

    Is there a way to install previous build?

    Here are the logs from event viewer:

    Приложение: devenv.exe
    Версия платформы: v4.0.30319
    Описание. Процесс был завершен из-за необработанного исключения.
    Сведения об исключении: StreamJsonRpc.ConnectionLostException
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(System.Threading.Tasks.Task)
    в StreamJsonRpc.JsonRpc+<InvokeCoreAsync>d__148.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в StreamJsonRpc.JsonRpc+<InvokeCoreAsync>d__1391[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext() в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) в Microsoft.Developer.IdentityService.PipeManager+<InvokeRpcFuncAsync>d__131[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.Developer.IdentityService.StorageService.StorageServiceClient+<GetAllAccountsAsyncInternalAsync>d__20.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.Developer.IdentityService.StorageService.StorageServiceClient+<GetAllAccountsAsync>d__19.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Shell.Connected.ConnectedUser.IdeUserContext+<HasPersonalizationAccount>d__12.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Shell.Connected.ConnectedUser.IdeUserContext+<AdjustSignInStatusAsync>d__11.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Shell.Connected.ConnectedUser.ConnectedUserPackage+<GetIdeUserContextAsync>d__7.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Shell.Connected.ConnectedUser.ConnectedUserPackage+<>c__DisplayClass6_0+<<InitializeAsync>b__1>d.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Shell.AsyncPackage+<>c__DisplayClass26_0+<<AddService>b__1>d.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Threading.AwaitExtensions+ExecuteContinuationSynchronouslyAwaiter1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetResult() в Microsoft.VisualStudio.Threading.AsyncLazy1+<>c__DisplayClass13_0+<<GetValueAsync>b__0>d[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
    в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    в Microsoft.VisualStudio.Services.VsTask.RethrowException(System.AggregateException)
    в Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean)
    в Microsoft.VisualStudio.Services.VsTask.GetResult()
    в Microsoft.VisualStudio.Services.AsyncQueryService.AsyncServiceProvider+<GetServiceByGuidThrowingAsync>d__25.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Threading.JoinableTask+<JoinAsync>d__70.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Shell.Connected.UserInformation.UserInformationDataSource+<InitializeDataSourceAsync>d__11.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Shell.VsTaskLibraryHelper+<>c__DisplayClass32_0+<<StartOnIdle>b__0>d.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Threading.JoinableTask+<JoinAsync>d__70.MoveNext()
    в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    в Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
    в Microsoft.VisualStudio.Threading.JoinableTask.Join(System.Threading.CancellationToken)
    в Microsoft.VisualStudio.Shell.Connected.UserInformation.UserInformationDataSource.UserInformationCommandHandler(Microsoft.VisualStudio.Shell.Interop.IVsUIDispatch, System.String, System.Object, System.Object ByRef)
    в Microsoft.Internal.VisualStudio.PlatformUI.UIDispatch.Invoke(System.String, System.Object, System.Object ByRef)
    в Microsoft.Internal.VisualStudio.PlatformUI.DataSource.Invoke(System.String, System.Object, System.Object ByRef)
    в Microsoft.VisualStudio.Shell.Connected.UserInformation.FirstLaunchSignIn.FirstLaunchSignIn_Loaded(System.Object, System.Windows.RoutedEventArgs)
    в Microsoft.VisualStudio.Shell.Connected.UserInformation.FirstLaunchSignIn.FirstLaunchSignIn_Loaded(System.Object, System.Windows.RoutedEventArgs)
    в System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
    в System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
    в System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
    в System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
    в System.Windows.BroadcastEventHelper.BroadcastEvent(System.Windows.DependencyObject, System.Windows.RoutedEvent)
    в System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(System.Object)
    в MS.Internal.LoadedOrUnloadedOperation.DoWork()
    в System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
    в System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
    в System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
    в System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)
    в System.Windows.Media.MediaContext.Resize(System.Windows.Media.ICompositionTarget)
    в System.Windows.Interop.HwndTarget.OnResize()
    в System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage, IntPtr, IntPtr)
    в System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
    в MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
    в MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
    в System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
    в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
    в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
    в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
    в MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
    в MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr, Int32, IntPtr, IntPtr)
    в MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
    в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

    Имя сбойного приложения: devenv.exe, версия: 16.9.31205.134, метка времени: 0x606b75b3
    Имя сбойного модуля: KERNELBASE.dll, версия: 10.0.18362.1316, метка времени: 0x7a6bfa05
    Код исключения: 0xe0434352
    Смещение ошибки: 0x001146d2
    Идентификатор сбойного процесса: 0x1394
    Время запуска сбойного приложения: 0x01d737cad1139db7
    Путь сбойного приложения: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe
    Путь сбойного модуля: C:\WINDOWS\System32\KERNELBASE.dll
    Идентификатор отчета: 74d9efb7-7022-45d7-9afe-67cbc8b7da63
    Полное имя сбойного пакета:
    Код приложения, связанного со сбойным пакетом:

    0 comments No comments

  5. Markus Pope 16 Reputation points
    2021-05-05T22:53:45.223+00:00

    Has anyone found a solution to this? Looking in the servicehub\logs folder, I'm getting log messages about this stupid file:

    05/05/2021 17:35:03 Central Standard Time : Error : Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at int SpanHelpers.IndexOf(ref byte searchSpace, byte value, int length) at int MemoryExtensions.IndexOf<T>(ReadOnlySpan<T> span, T value) at SequencePosition? System.Buffers.BuffersExtensions.PositionOf<T>(in ReadOnlySequence<T> source, T value) at async ValueTask<(ValueTuple<int?, Encoding> ContentLength)> StreamJsonRpc.HeaderDelimitedMessageHandler.ReadHeadersAsync(CancellationToken cancellationToken) at async ValueTask<JsonRpcMessage> StreamJsonRpc.HeaderDelimitedMessageHandler.ReadCoreAsync(CancellationToken cancellationToken) at async ValueTask<JsonRpcMessage> StreamJsonRpc.MessageHandlerBase.ReadAsync(CancellationToken cancellationToken) at async Task StreamJsonRpc.JsonRpc.ReadAndHandleRequestsAsync()

    At the same time, I'm seeing this in the activitylog.xml file: <entry> <record>63</record> <time>2021/05/05 22:41:19.876</time> <type>Error</type> <source>GetIdeUserContextAsync</source> <description>StreamJsonRpc.ConnectionLostException: The JSON-RPC connection with the remote party was lost before the request could complete.&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)&#x000D;&#x000A; at StreamJsonRpc.JsonRpc.&lt;InvokeCoreAsync&gt;d__148.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at StreamJsonRpc.JsonRpc.&lt;InvokeCoreAsync&gt;d__1391.MoveNext()&amp;#x000D;&amp;#x000A;--- End of stack trace from previous location where exception was thrown ---&amp;#x000D;&amp;#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&amp;#x000D;&amp;#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&amp;#x000D;&amp;#x000A; at Microsoft.Developer.IdentityService.PipeManager.&amp;lt;InvokeRpcFuncAsync&amp;gt;d__131.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at Microsoft.Developer.IdentityService.StorageService.StorageServiceClient.&lt;GetAllAccountsAsyncInternalAsync&gt;d__20.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at Microsoft.Developer.IdentityService.StorageService.StorageServiceClient.&lt;GetAllAccountsAsync&gt;d__19.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.IdeUserContext.&lt;HasPersonalizationAccount&gt;d__12.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.IdeUserContext.&lt;AdjustSignInStatusAsync&gt;d__11.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.ConnectedUserPackage.&lt;GetIdeUserContextAsync&gt;d__7.MoveNext()</description> </entry>

    0 comments No comments