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

Nathan Sokalski 4,111 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

Developer technologies | Visual Studio | Other
{count} votes

20 answers

Sort by: Most helpful
  1. Jonathan C 11 Reputation points
    2022-12-07T13:13:50.03+00:00

    Same issue here, but most of the time I've noticed it's the "feature diagnostic analyzer" that causes the crash.
    VS freezes and only solution is to force close via Task Manager.
    Tried repair but doesn't seem to fix the issue. Updated VS2022 to latest version (17.4.2)
    Checked and CPU/RAM/HDD resources are ok on my dev machine.
    If it makes any difference my project is connected to TFS.

    By the time it freezes I can't even click to view stack trace. I will also lose any unsaved work which is painful.

    edit: managed to grab stack trace this time.

    268211-image.png

      StreamJsonRpc.RemoteInvocationException: Cannot enqueue data after PromiseNotToEnqueue.  
           at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__143`1.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.BrokeredServiceConnection`1.<TryInvokeAsync>d__16`1.MoveNext()  
        RPC server exception:  
        System.InvalidOperationException: Cannot enqueue data after PromiseNotToEnqueue.  
              at Microsoft.CodeAnalysis.Diagnostics.AsyncQueue`1.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, Predicate`1 filterOpt, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.<GetDiagnosticsForMethodBodiesInTree>g__compileMethodBodiesAndDocComments|216_0(SyntaxTree filterTree, Nullable`1 filterSpan, BindingDiagnosticBag bindingDiagnostics, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForMethodBodiesInTree(SyntaxTree tree, Nullable`1 span, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForSyntaxTree(CompilationStage stage, SyntaxTree syntaxTree, Nullable`1 filterSpanWithinTree, Boolean includeEarlierStages, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDiagnostics(Nullable`1 span, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GenerateCompilationEvents(AnalysisScope analysisScope, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerDiagnosticsAsync(AnalysisScope analysisScope, Func`1 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, Nullable`1 filterSpan, ImmutableArray`1 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, BidirectionalMap`2 analyzerToIdMap, ImmutableArray`1 analyzers, SkippedHostAnalyzersInfo skippedAnalyzersInfo, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.GetDiagnosticsAsync(IEnumerable`1 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_0`1.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()  
           --- End of stack trace from previous location ---  
              at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func`2 implementation, CancellationToken cancellationToken)  
              at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.CalculateDiagnosticsAsync(Checksum solutionChecksum, DiagnosticArguments arguments, CancellationToken cancellationToken)  
          
    
    0 comments No comments

  2. Samtown 0 Reputation points
    2023-02-22T04:44:07.53+00:00

    Updated to 17.5.0,it never happened again.

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  5. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.