首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法加载文件或程序集“System.IO.Pipelines”

无法加载文件或程序集“System.IO.Pipelines”
EN

Stack Overflow用户
提问于 2019-01-02 17:13:35
回答 1查看 8.3K关注 0票数 2

最近,我将控制台应用程序项目从框架4.5.2升级到了4.6.1。一切都在开发环境中正常工作,但是当我将完整的bin文件夹部署到我的生产环境时,我会得到以下错误。

未处理的异常: System.IO.FileLoadException:无法加载文件或程序集'System.IO.Pipelines、Version=4.6.26919.2、Culture=neutral、PublicKeyToken=cc7b13ffcd2ddd51‘或其依赖项之一。所定位的程序集的清单定义与程序集引用不匹配。(HRESULT例外: 0x80131040)

我在生产中设置了绑定重定向,如下所示:

代码语言:javascript
复制
  <dependentAssembly>
    <assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.6.26919.2" />
  </dependentAssembly>

该文件肯定存在于bin文件夹中,并且我的生产环境安装了框架4.6.2。有什么想法吗?

根据FUSLOGVW的输出更新:

代码语言:javascript
复制
*** Assembly Binder Log Entry  (1/2/2019 @ 11:47:22 AM) ***

The operation failed.
Bind result: hr = 0x80131040. No description available.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  {{REDACTED}}\NotificationService.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = System.IO.Pipelines, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
 (Fully-specified)
LOG: Appbase = file:///{{REDACTED}}/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NotificationService.exe
Calling assembly : Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: {{REDACTED}}\NotificationService.exe.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.IO.Pipelines, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///{{REDACTED}}/System.IO.Pipelines.DLL.
LOG: Assembly download was successful. Attempting setup of file: {{REDACTED}}\System.IO.Pipelines.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-01-02 18:16:01

使用微软的“程序集绑定日志查看器”(Fuslogvw.exe),它将告诉您正在处理哪些绑定请求以及哪些绑定请求失败。

https://learn.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer

如果生产环境中没有安装fuslogvw.exe,那么请检查以下内容:using FUSLOGVW.EXE on a machine with no Visual Studio installed

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54010475

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档