【发布时间】:2019-06-09 15:15:43
【问题描述】:
我有一个 .NET 项目,它引用了一个依赖于 Newtonsoft.Json 版本 6.0.8 的 nuget。 nuget 是https://www.nuget.org/packages/Microsoft.Azure.KeyVault/3.0.2
我想在我的项目中只使用最新版本的 Newtonsoft,所以我希望这个项目实际使用 12.0 版的 Newtonsoft。我不确定这是否可能。我尝试将 app.config 文件添加到我的项目中,但没有成功。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.1.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
有什么方法可以实现吗?
【问题讨论】:
-
你真的想要那个吗?如果他们在新版本中破坏了某些东西怎么办?
-
Floating Versions 如果使用 .NET Core 项目、.NET Standard 项目和面向 Creators Update 及更高版本的 UWP 项目中默认使用的新项目格式,则 PackageReference 元素支持:@ 987654323@
-
如果我在 Nuget 页面上的“依赖项”下查看,我看到 Newtonsoft 的推荐版本是:Newtonsoft.Json (>= 6.0.8) 所以,11 是 >= 6.0.8,我恢复它不会破坏任何东西。
标签: c# json.net dependencies nuget-package