Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
323 views
in Technique[技术] by (71.8m points)

Azure Cognitive Search Throwing System.NullReferenceException

I'm trying to use the Azure Cognitive Search UI. I have cloned the repository for the Knowledge Mining solution accelerator (git clone https://github.com/Azure-Samples/azure-search-knowledge-mining.git). When running the solution, it throws a system null reference exception (Object reference not set to an instance of an object) pointing out the Home Controller file.

Does anyone know how to solve this issue?

Thanks, Frank

question from:https://stackoverflow.com/questions/65879435/azure-cognitive-search-throwing-system-nullreferenceexception

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The type of error you mention are almost always caused by some sort of issue with the appsettings.json file where the servicename/api key/ etc. are set. One good way to debug is to put a breakpoint in the constructor of DocumentSearchClient.cs. on lines 59 and 81. There you can catch potentially catch the error and then dig into the inner exception.

If the debugging doesn't reveal the problem, do raise an issue on the git repo.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...