首页 > 其他 > 详细

The assembly for System.Buffers could not be loaded;无法加载System.Buffers的程序集

时间:2019-06-24 10:34:04      阅读:415      评论:0      收藏:0      [点我收藏+]

调用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也依赖于  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

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)的引用,并设置为复制到输出目录

 

参考链接:

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

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

 

The assembly for System.Buffers could not be loaded;无法加载System.Buffers的程序集

原文:https://www.cnblogs.com/xytmj/p/11075510.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!