我正在使用 Azure 搜索 .Net SDK。
我正在调用这样的同步(非异步)函数:
var searchResults = searchIndexClient.Documents.Search<T>(searchText, searchParameters);
它通常有效。我没有使用任何异步函数,但不知何故,我刚刚得到的错误看起来像一个异步错误:
System.Threading.Tasks.TaskCanceledException: A task was canceled.
CancellationToken: IsCanceleationRequested=false
Task: Id = 556, Status = Canceled, Method = "{null}", Result = "{Not yet computed}"
StackTrace:
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Search.DocumentsOperations.<DoContinueSearchWithHttpMessagesAsync>d__15
3.MoveNext() --- 从上一个堆栈跟踪结束引发异常的位置 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() .Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Search.DocumentsOperationsExtensions.<SearchAsync>d__15
1.MoveNext() --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 的 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 处从先前引发异常的位置结束堆栈跟踪.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.Azure.Search.DocumentsOperationsExtensions.Search[T](IDocumentsOperations operations, String searchText, SearchParameters searchParameters, SearchRequestOptions searchRequestOptions) at MyApp.AzureSearch.AzureSearchService.PerformSearch[T](String searchText, SearchParameters searchParameters) in c:\Projects\MyAppServer\src\MyApp.AzureSearch\AzureSearchService.cs:line 359 at MyApp.AzureSearch.AzureSearchService.Search[T](String searchText, List
1 searchFields, SearchMode searchMode, List1 select, Nullable
1 skip, Nullable1 top, String filter, Boolean includeTotalResultCount, List
1 orderBy) 在 c:\Projects\MyAppServer\src\MyApp.AzureSearch\AzureSearchService。 cs:MyApp.AzureSearch.AzureSearchService.SearchEmails 的第 262 行(Guid userId,字符串来源,字符串 searchText,可空1 skip, Nullable
1 顶部,布尔值 includeTotalResultCount,布尔值 includeHtmlBody,布尔值 orderByProcessedAscending,字符串交互状态)在 c:\Projects\MyAppServer\src\MyApp.AzureSearch\AzureSearchService.cs:MyApp.Domain.MyAppMessages.Command.MyAppMessagesAllNoticedUpdater.Handle(VisitorSession userSession) 的第 167 行, NoticeAllMyAppMessages processCommand) 在 c:\Projects\MyAppServer\src\MyApp.Domain\MyAppMessages\Command\MyAppMessagesAllNoticedUpdater.cs:line 30