【发布时间】:2013-10-14 01:57:45
【问题描述】:
我需要加载 2 个版本的程序集 Newtonsoft.Json 版本 4.0.8.0 和 4.5.0.0。我当前的配置文件:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" />
</dependentAssembly>
但必须是:旧 4.0.8.0 和新 4.5.0.0
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.5.0.0" />
</dependentAssembly>
我从包控制台安装了 Newtonsoft - 最新版本 - 但它给了我一个错误:
错误 80 无法加载文件或程序集“Newtonsoft.Json,版本=4.5.0.0,Culture=neutral,PublicKeyToken=30ad4fe6b2a6aeed”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)**
【问题讨论】:
-
我检查了 JSON.net NuGet 发布信息,但我找不到发布 4.5.0.0 nuget.org/packages/newtonsoft.json 此外,如果您已经拥有最新版本的库,您需要使用旧版本?
-
为什么我记得在 nuget 之前一切都变得如此简单?
标签: .net json.net .net-assembly