zoukankan      html  css  js  c++  java
  • The assembly for System.Buffers could not be loaded;无法加载System.Buffers的程序集

    调用Redis类库: StackExchange/StackExchange.Redis  进行Redis连接时,有时会发生:

    如下错误

    英文:

    The assembly for System.Buffers could not be loaded; this usually means a missing assembly binding redirect - try checking this, and adding any that are missing; note that it is not always possible to add this redirects - for example 'azure functions v1'; it looks like you may need to use 'azure functions v2' for that - sorry, but that's out of our control

    中文:

    无法加载System.Buffers的程序集;这通常意味着缺少程序集绑定重定向-请尝试检查此重定向,并添加任何缺少的重定向;请注意,并不总是可以添加此重定向-例如“Azure函数v1”;看起来您可能需要使用“Azure函数v2”进行重定向-抱歉,但这已超出您的权限。

    原因分析:

    参考链接:https://github.com/dotnet/corefx/issues/32511

    Pipelines.Sockets.Unofficial 类库,依赖与:

    System.IO.Pipelines (>= 4.5.1) 

    System.Buffers (>= 4.4.0) 

     而System.IO.Pipelines(4.5.1)版本依赖于 

    NETStandard.Library (>= 1.6.1)

    System.Memory (>= 4.5.1)

    System.Buffers (>= 4.4.0) 

    System.Threading.Tasks.Extensions (>= 4.5.1)

     而System.IO.Pipelines(4.5.3)版本依赖于

     System.Memory (>= 4.5.1)

     System.Buffers (>= 4.4.0) 

    如果系统里面引用的System.IO.Pipelines 和 System.Buffers 文件版本,低于要求: System.IO.Pipelines (>= 4.5.1)  、 System.Buffers (>= 4.4.0)  时,就会发生上述依赖报错问题。

    解决方法:

    1.查找所有项目引用,更新类库Pipelines.Sockets.Unofficial 到最新版本(当前是 v2.0.22)

    2.查找所有项目引用,更新 System.IO.Pipelines 类库版本,版本至少要 >= 4.5.1,最好是 >= 4.5.2,这样只会引用 System.Memory (>= 4.5.1)、  System.Buffers (>= 4.4.0) 两个文件,而4.5.1版本需要引用4个文件

    3.查找所有项目引用,更新 System.Buffers 类库版本,版本至少要 >= 4.4.0

    如果连接时出现如下异常 :

    未能加载文件或程序集“System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51”或它的某一个依赖项。系统找不到指定的文件。

    说明bin目录下没有System.IO.Pipelines文件,此时可以在启动项目.exe项目下,添加对System.IO.Pipelines(版本至少要 >= 4.5.1)的引用,并设置为复制到输出目录

     如果引用的是 System.IO.Pipelines ( v4.5.1)  且引用了 System.Threading.Tasks.Extensions (版本低于4.5.2),也会报错,因为System.IO.Pipelines ( v4.5.1) 需要引用 System.Threading.Tasks.Extensions (>= 4.5.2)

    参考链接:

    https://github.com/dotnet/corefx/issues/32511

    https://github.com/dotnet/corefx/issues/32457

  • 相关阅读:
    前天去游泳了
    Microsoft今天开了中文的MSDN了,以后查资料有时要快了点吧
    Visual Studio .NET已检测到指定的WEB服务运行的不是ASP.NET 1.1版
    sqlserver 2005 利用游标解决标量值函数主键自增id批量导入数据问题
    nvarchar查询条件中不用加单引号''吗?
    使用标量值函数作为主键自增值的时候,动软代码生成器的插入方法需要去掉主键的参数。
    c#里的'0','1'对应sqlserver2005中的False,True
    三元运算符绑定缩略内容
    循环插入数据存储过程
    01|02|03| ====> (01,02,03)用于in id数组这种查询方式
  • 原文地址:https://www.cnblogs.com/xytmj/p/11075510.html
Copyright © 2011-2022 走看看