asp.net-web-api - NewtonJson.NET 版本 4.0.8.0 的 RavenDb 客户端问题

标签 asp.net-web-api ravendb json.net

我在集成测试项目中遇到 RavenDb 客户端和 NewtonJson.NET 问题。 我收到以下异常:

Assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' which has a higher version than referenced assembly 'Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ...\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll

我需要使用 System.Net.Http.Formatting,它使用 NewtonSoft.Json 4.5.0.0 和 RavenDb 客户端使用 4.0.8.0。 我不想使用不稳定的 RavenDb 版本,因为此代码需要快速投入生产。 你有什么解决办法吗?

最佳答案

使用RavenDB 1.0.972(稳定),它依赖于NewtonSoft.Json 4.5.7。您可以在 NuGet 上找到它。

https://nuget.org/packages/RavenDB.Client/1.0.972

关于asp.net-web-api - NewtonJson.NET 版本 4.0.8.0 的 RavenDb 客户端问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12795378/

相关文章:

c# - 当数据过大时,发布请求不起作用 .net 核心 web api

c# - 为什么我在使用带有安全 URL 的 HttpResponseMessage 时得到 401 未经授权?

c# - 尝试让简单的测试项目和 RavenDB 一起工作时出现奇怪的错误

nosql - NoSql (RavenDB) 的多对多设计

json - 在PowerShell中了解NewtonSoft

c# - 将 JSON 解析为 JToken 时如何将所有键更改为小写

c# - 在 C# 方法中测试错误输入

asp.net - 如何将 FormsAuthentication cookie 添加到 HttpClient HttpRequestMessage

c# - RavenDb NLog 配置冲突

c# - 从 WebApi 中的 snake case JSON 自动绑定(bind) pascal case c# 模型