【发布时间】:2021-04-28 22:38:46
【问题描述】:
我正在尝试使用 Azure 认知搜索 UI。我已经克隆了知识挖掘解决方案加速器的存储库(git clone https://github.com/Azure-Samples/azure-search-knowledge-mining.git)。运行解决方案时,它会引发系统空引用异常(对象引用不 设置为对象的实例)指出 Home Controller 文件。
有人知道如何解决这个问题吗?
谢谢, 弗兰克
【问题讨论】:
-
能否给出出错的代码?
-
见下面的代码,
public ActionResult Suggest(string term, bool fuzzy = true) { var response = _docSearch.Autocomplete(term, fuzzy); List<string> suggestions = new List<string>(); if (response != null) { foreach (var result in response.Results) { suggestions.Add(result.Text); } } -
请参阅下面的异常和代码,> System.NullReferenceException > HResult=0x80004003 >Message=对象引用未设置为对象的实例。 > Source=CognitiveSearch.UI > StackTrace: > 在 C:\Users***\source\repos\azure-search-knowledge-mining\02 中的 CognitiveSearch.UI.Controllers.HomeController.Suggest(字符串术语,布尔值 > 模糊) - Web UI > Template\CognitiveSearch.UI\Controllers\HomeController.cs:line 182
-
对格式很抱歉,但我是使用 stackoverflow 的新手
标签: azure azure-cognitive-search