c# - 无法在已发布的可执行文件上加载文件或程序集 System.Net.Http.Primitives

标签 c# nuget linq-to-twitter

我正在使用随 NuGet 安装的 linqtotwitter (v3.0.3)。

它与 VS2012 .NET 4.5 一起工作

但是当我尝试部署时,在运行时出现这个错误;

Could not load file or assembly 'System.Net.Http.Primitives, ... or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

System.Net.Http.Primitives.dll 在文件夹中。

有什么想法吗?

最佳答案

我刚刚解决了同样的问题。查看您的本地 web.config 并查看已添加到运行时 > assemblyBinding 部分的内容。

我将其添加到我的实时 web.config 中并解决了问题。

  <dependentAssembly>
    <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.2.22.0" newVersion="4.2.22.0" />
  </dependentAssembly>

关于c# - 无法在已发布的可执行文件上加载文件或程序集 System.Net.Http.Primitives,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23855249/

相关文章:

c# - 使用 Lambda OrderBy Comparer 为特定字符串值赋予权重

msbuild - 卡住不活动的 msbuild.exe 进程、锁定的 Stylecop.dll、Nuget AccessViolationException 和 CI 构建相互冲突之谜

c# - 如何使用 C# 和 LINQ to Twitter 库更新 Twitter 上的状态

Twitter 状态 ID

c# 如何发送仍在写入的文件流并一直发送到创建结束

c# - CreateObject 等效于 C# 4、动态关键字和后期绑定(bind)?

nuget - 如何在命令行中获取可用的nuget更新列表?

c# - 使用 LINQ to Twitter 查找不活跃的 Twitter 关注者的最有效方法

c# - 哪个 xml 结构允许更快的添加/删除/更新

nuget - 如何从 NuGet 包中排除 T4 模板