Skip to content

InvalidOperationException: WaitAndGetResult cannot be called from a thread pool thread #58612

@tmat

Description

@tmat
System.InvalidOperationException: WaitAndGetResult cannot be called from a thread pool thread.\r
   at Roslyn.Utilities.TaskExtensions.WaitAndGetResult[T](Task`1 task, CancellationToken cancellationToken) in D:\R1\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs:line 43\r
   at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.DefaultDefinitionItem.TryResolveSymbolInCurrentSolution(Workspace workspace, String symbolKey) in D:\R1\src\Features\Core\Portable\FindUsages\DefinitionItem.DefaultDefinitionItem.cs:line 120\r
   at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.DefaultDefinitionItem.TryNavigateToMetadataSymbol(Workspace workspace, String symbolKey, Func`4 action) in D:\R1\src\Features\Core\Portable\FindUsages\DefinitionItem.DefaultDefinitionItem.cs:line 90\r
   at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.DefaultDefinitionItem.CanNavigateToMetadataSymbol(Workspace workspace, String symbolKey) in D:\R1\src\Features\Core\Portable\FindUsages\DefinitionItem.DefaultDefinitionItem.cs:line 74\r
   at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.DefaultDefinitionItem.<CanNavigateToAsync>d__5.MoveNext() in D:\R1\src\Features\Core\Portable\FindUsages\DefinitionItem.DefaultDefinitionItem.cs:line 54\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()\r
   at Microsoft.CodeAnalysis.Editor.GoToDefinition.AbstractGoToSymbolService.<GetSymbolsAsync>d__1.MoveNext() in D:\R1\src\EditorFeatures\Core\GoToDefinition\AbstractGoToSymbolService.cs:line 42\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()\r
   at Microsoft.CodeAnalysis.Editor.NavigableSymbols.NavigableSymbolService.NavigableSymbolSource.<GetNavigableSymbolAsync>d__7.MoveNext() in D:\R1\src\EditorFeatures\Core.Wpf\NavigableSymbols\NavigableSymbolService.NavigableSymbolSource.cs:line 66\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<QueryNavigableSymbolAsync>d__34.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__32.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__32.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<>c__DisplayClass31_0.<<SetMouseCursorAndNavigableSpanAsync>b__0>d.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__76.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at Microsoft.VisualStudio.Threading.JoinableTask`1.<<JoinAsync>g__JoinSlowAsync|3_0>d.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanAsync>d__31.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.<CallExtensionPointAsync>d__37.MoveNext()\r
--- End of stack trace from previous location where exception was thrown ---\r
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Metadata

Metadata

Assignees

Labels

Area-IDEBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implemented

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions