Newtonsoft.Json 12.0.0.0版引发Hashtable序列化异常

时间:2019-04-19 13:57:08

标签: c# json.net swagger-ui

当我执行我的应用程序时,它从以下错误中的 Newtonsoft.Json 12.0.0.0 dll 引发错误:

Http Error 500 : { "Message":"An error has occurred.", "ExceptionMessage":"Type System.Collections.Hashtable& is not a dictionary." }

当我使用 Newtonsoft.Json 11.0.0.0 dll 时,它工作正常。

下面是从Swagger UI(http://localhost:54738/swagger/ui/index)调用的API方法:

 [HttpGet]
 public SortedList<int, XElement> getVariableStates(string sInstanceID, [FromBody] ref Hashtable oVarsDic)
 {

 }

更新到Newtonsoft.Json 12.0.0.0 dll后,我收到HashTable异常。

Descirption Image Here

0 个答案:

没有答案