gpt4 book ai didi

asp.net-web-api - 方法未找到 : 'Void Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)' (webapi and PCL)

转载 作者:行者123 更新时间:2023-12-04 00:01:47 25 4
gpt4 key购买 nike

类似于 this question ,被标记为重复(所以我无法直接回答)。

我有一个 webapi 项目,它引用了一个 PCL 项目。
我间歇性地收到此 DefaultContractResolver 错误。

我已经尝试了其他问题的所有故障排除步骤,主要涉及卸载和重新安装 nuget 软件包。没有帮助。

最佳答案

我的问题的根本原因是我的 webapi 项目和我的 PCL 项目都引用了 Newtonsoft.Json.dll。 Visual Studio 构建中似乎存在某种竞争条件,因此如果 PCL 项目是最后构建的,它会将其可移植版本的 Newtonsoft.Json.dll 复制到我的 webapi 项目的\bin 目录中。

解决方案只是进入我的 PCL 项目的引用,并关闭 Newtonsoft.Json.dll 的“复制本地”

关于asp.net-web-api - 方法未找到 : 'Void Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)' (webapi and PCL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27812705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com