NuGet 包和 .Net MVC 参考 (105.2.3) 中 RestSharp 参考 (106.10.1) 的不同版本
Different version for RestSharp reference(106.10.1) in NuGet package & .Net MVC reference (105.2.3)
我有一个使用用户定义的 NuGet 包的 .Net MVC 项目,该项目具有 RestSharp 版本 - 105.2.3,同样的 .Net MVC 也引用了 RestSharp 版本 - 106.10.1
使用此设置我遇到以下错误:
{"Could not load file or assembly 'RestSharp, Version=105.2.3.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)":"RestSharp,
Version=105.2.3.0, Culture=neutral, PublicKeyToken=null"}
我怀疑你需要告诉你的程序使用更新的版本。
在我的项目中,我已将以下内容添加到我的配置中以解决与您遇到的类似问题(使用 Newtonsoft JSON):
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
看到这个post:
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions
我有一个使用用户定义的 NuGet 包的 .Net MVC 项目,该项目具有 RestSharp 版本 - 105.2.3,同样的 .Net MVC 也引用了 RestSharp 版本 - 106.10.1
使用此设置我遇到以下错误:
{"Could not load file or assembly 'RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null"}
我怀疑你需要告诉你的程序使用更新的版本。
在我的项目中,我已将以下内容添加到我的配置中以解决与您遇到的类似问题(使用 Newtonsoft JSON):
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
看到这个post:
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions