"Feature 'XXX' is currently unavailable due to an internal error."

Nathan Sokalski 4,116 Reputation points
2021-12-25T04:05:33.293+00:00

Visual Studio 2022 recently started (for absolutely no reason) displaying the following message(s) at the top of the Visual Studio 2022 window:

Feature 'Diagnostic analyzer runner' is currently unavailable due to an internal error.

Similar messages are displayed for many other features (the list is endless!). This started happening for no reason, I did not change (or even open) the settings or preferences, I did not create (or even edit) any files, I did not install any updates, I barely used my computer. Here is a screenshot of the messages:

160270-screenshot-2021-12-24-225853.png

If I close all the files, it sometimes lets me click the X on the right to get rid of the messages, but then they come back when I reopen the files. What is the problem? I have not tried to repair Visual Studio 2022 (that is, in my opinion, a last resort, since it doesn't always fix the problem). I currently have:

Microsoft Visual Studio Community 2022 (64-bit)
Version 17.0.4

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,621 questions
{count} votes

43 answers

Sort by: Most helpful
  1. Christian Schulz 1 Reputation point
    2022-11-25T07:58:30.023+00:00

    I have the same errors on every tab change in editor (VS 2022 17.4.1)

    Stacktrace:

    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>)

    0 comments No comments

  2. Colin Forbes 1 Reputation point
    2022-11-25T19:49:17.373+00:00

    Same Issues. Started after upgrading to Version 17.4.1.

    Stack Trace:
    StreamJsonRpc.RemoteInvocationException: Cannot enqueue data after PromiseNotToEnqueue.
    at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__1431.MoveNext() \--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__161.MoveNext() RPC server exception: System.InvalidOperationException: Cannot enqueue data after PromiseNotToEnqueue. at Microsoft.CodeAnalysis.Diagnostics.AsyncQueue1.EnqueueCore(TElement value)
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethod(MethodSymbol methodSymbol, Int32 methodOrdinal, ProcessedFieldInitializers& processedInitializers, SynthesizedSubmissionFields previousSubmissionFields, TypeCompilationState compilationState)
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType)
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.<>c__DisplayClass25_0.<CompileNamedTypeAsync>b__0()
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
    --- End of stack trace from previous location ---
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.WaitForWorkers()
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethodBodies(CSharpCompilation compilation, PEModuleBuilder moduleBeingBuiltOpt, Boolean emittingPdb, Boolean emitTestCoverageData, Boolean hasDeclarationErrors, Boolean emitMethodBodies, BindingDiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.<GetDiagnosticsForMethodBodiesInTree>g__compileMethodBodiesAndDocComments|216_0(SyntaxTree filterTree, Nullable1 filterSpan, BindingDiagnosticBag bindingDiagnostics, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForMethodBodiesInTree(SyntaxTree tree, Nullable1 span, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForSyntaxTree(CompilationStage stage, SyntaxTree syntaxTree, Nullable1 filterSpanWithinTree, Boolean includeEarlierStages, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDiagnostics(Nullable1 span, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GenerateCompilationEvents(AnalysisScope analysisScope, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerDiagnosticsAsync(AnalysisScope analysisScope, Func1 getPendingEventsOpt, Int32 newTaskToken, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerSemanticDiagnosticsAsync(SemanticModel model, AnalysisScope analysisScope, CancellationToken cancellationToken, Boolean forceCompletePartialTrees)
    at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultCoreAsync(SemanticModel model, Nullable1 filterSpan, ImmutableArray1 analyzers, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, Project project, DiagnosticAnalyzerInfoCache analyzerInfoCache, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.AnalyzeAsync(CompilationWithAnalyzers compilationWithAnalyzers, BidirectionalMap2 analyzerToIdMap, ImmutableArray1 analyzers, SkippedHostAnalyzersInfo skippedAnalyzersInfo, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.GetDiagnosticsAsync(IEnumerable1 analyzerIds, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.<>c__DisplayClass4_0.<<CalculateDiagnosticsAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()
    --- End of stack trace from previous location ---
    at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsyncT
    at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsyncT
    at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsyncT
    at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.CalculateDiagnosticsAsync(Checksum solutionChecksum, DiagnosticArguments arguments, CancellationToken cancellationToken)


  3. Martin Kariuki 1 Reputation point
    2022-11-26T08:15:57.823+00:00

    I closed my project and restarted again. The issue was gone , at least by the time I am writing this feedback.

    0 comments No comments

  4. imw 1 Reputation point
    2022-11-28T00:00:02.133+00:00

    Have the same issue after upgrading to version 17.4.1

    StreamJsonRpc.RemoteInvocationException: Cannot enqueue data after PromiseNotToEnqueue.
    at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__1431.MoveNext() \--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__161.MoveNext() RPC server exception: System.InvalidOperationException: Cannot enqueue data after PromiseNotToEnqueue. at Microsoft.CodeAnalysis.Diagnostics.AsyncQueue1.EnqueueCore(TElement value)
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethod(MethodSymbol methodSymbol, Int32 methodOrdinal, ProcessedFieldInitializers& processedInitializers, SynthesizedSubmissionFields previousSubmissionFields, TypeCompilationState compilationState)
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType)
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.<>c__DisplayClass25_0.<CompileNamedTypeAsync>b__0()
    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
    --- End of stack trace from previous location ---
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.WaitForWorkers()
    at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethodBodies(CSharpCompilation compilation, PEModuleBuilder moduleBeingBuiltOpt, Boolean emittingPdb, Boolean emitTestCoverageData, Boolean hasDeclarationErrors, Boolean emitMethodBodies, BindingDiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.<GetDiagnosticsForMethodBodiesInTree>g__compileMethodBodiesAndDocComments|216_0(SyntaxTree filterTree, Nullable1 filterSpan, BindingDiagnosticBag bindingDiagnostics, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForMethodBodiesInTree(SyntaxTree tree, Nullable1 span, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForSyntaxTree(CompilationStage stage, SyntaxTree syntaxTree, Nullable1 filterSpanWithinTree, Boolean includeEarlierStages, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDiagnostics(Nullable1 span, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GenerateCompilationEvents(AnalysisScope analysisScope, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerDiagnosticsAsync(AnalysisScope analysisScope, Func1 getPendingEventsOpt, Int32 newTaskToken, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerSemanticDiagnosticsAsync(SemanticModel model, AnalysisScope analysisScope, CancellationToken cancellationToken, Boolean forceCompletePartialTrees)
    at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultCoreAsync(SemanticModel model, Nullable1 filterSpan, ImmutableArray1 analyzers, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, Project project, DiagnosticAnalyzerInfoCache analyzerInfoCache, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.AnalyzeAsync(CompilationWithAnalyzers compilationWithAnalyzers, BidirectionalMap2 analyzerToIdMap, ImmutableArray1 analyzers, SkippedHostAnalyzersInfo skippedAnalyzersInfo, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken)
    at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.GetDiagnosticsAsync(IEnumerable1 analyzerIds, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.<>c__DisplayClass4_0.<<CalculateDiagnosticsAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()
    --- End of stack trace from previous location ---
    at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsyncT
    at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsyncT
    at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsyncT
    at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.CalculateDiagnosticsAsync(Checksum solutionChecksum, DiagnosticArguments arguments, CancellationToken cancellationToken)

    0 comments No comments

  5. Miki Tinggaard Andersen 1 Reputation point
    2022-11-28T13:23:30.1+00:00

    Same here :-(

    0 comments No comments