Azure Search .NET SDK抛出InvalidOperationException SerializationBinder,其中Newtonsoft.Json版本高于9.0.1

时间:2018-04-04 16:12:18

标签: azure azure-search

我收到一条错误消息System.MissingMethodException:找不到方法:将NewtonSoft.Json更新到版本10.0.3后Azure.net SDK中的'Newtonsoft.Json.SerializationBinder'

这是StackTrace的一部分

at Microsoft.Azure.Search.JsonUtility.CopySettings(JsonSerializerSettings baseSettings)
   at Microsoft.Azure.Search.JsonUtility.CreateDeserializerSettings[TSearchResult,TSuggestResult,TDoc](JsonSerializerSettings baseSettings)
   at Microsoft.Azure.Search.DocumentsOperations.DeserializeForSearch[T](String payload)
   at Microsoft.Azure.Search.DocumentsOperations.<DoContinueSearchWithHttpMessagesAsync>d__21`3.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.Azure.Search.DocumentsOperationsExtensions.<SearchAsync>d__17`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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

我正在使用最新版本的Microsoft.Azure.Search和.Net Core

1 个答案:

答案 0 :(得分:3)

这是known issue。请确保您使用的是Microsoft.Azure.Search 5.0.0版(或更新的版本)。