【问题标题】:Assembly reference warnings?装配参考警告?
【发布时间】:2015-04-22 12:12:37
【问题描述】:

如何解决此程序集引用警告?

System.Net.Http.Formatting.dll: 警告 CS1701: 假设程序集引用'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' 匹配 'Newtonsoft.Json, 版本=6.0.0.0,文化=中性,PublicKeyToken=30ad4fe6b2a6aeed', 您可能需要提供运行时策略 Newtonsoft.Json.dll:(位置 与先前警告相关的符号)

【问题讨论】:

  • 尝试更新包。更新包 Newtonsoft.Json

标签: asp.net


【解决方案1】:

尝试将bindingRedirect 添加到应用程序的web.config 文件中。

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

【讨论】:

  • 添加到 machine.config 文件中
猜你喜欢
  • 1970-01-01
  • 2011-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-22
相关资源
最近更新 更多