欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

关于“Failed to complete setup of assembly(hr = 0x80131040). Probing terminated”

程序员文章站 2023-08-25 14:02:48
场景:动态库UFileDev(运行时版本v4.0.30319)内置方法调用了动态库ICSharpCode.SharpZipLib(运行时版本v2.0.50727)。调用动态库UFileDev过程中一直报错如下: Pre-bind state information LOG: DisplayName ......

  场景:动态库ufiledev(运行时版本v4.0.30319)内置方法调用了动态库icsharpcode.sharpziplib(运行时版本v2.0.50727)。调用动态库ufiledev过程中一直报错如下:

=== pre-bind state information ===
log: displayname = icsharpcode.sharpziplib, version=0.86.0.518, culture=neutral, publickeytoken=1b03e6acf1164f73
(fully-specified)
log: appbase = file:///g:/program_test/webapitest/
log: initial privatepath = g:\program_test\webapitest\bin
calling assembly : ufiledev, version=1.0.0.0, culture=neutral, publickeytoken=a7bcd44e2dce6fe6.
===
log: this bind starts in default load context.
log: using application configuration file: g:\program_test\webapitest\web.config
log: using host configuration file: c:\windows\microsoft.net\framework64\v4.0.30319\aspnet.config
log: using machine configuration file from c:\windows\microsoft.net\framework64\v4.0.30319\config\machine.config.
log: post-policy reference: icsharpcode.sharpziplib, version=0.86.0.518, culture=neutral, publickeytoken=1b03e6acf1164f73
log: attempting download of new url file:///c:/windows/microsoft.net/framework64/v4.0.30319/temporary asp.net files/webapitest/3f0358dc/ff934c92/icsharpcode.sharpziplib.dll.
log: attempting download of new url file:///c:/windows/microsoft.net/framework64/v4.0.30319/temporary asp.net files/webapitest/3f0358dc/ff934c92/icsharpcode.sharpziplib/icsharpcode.sharpziplib.dll.
log: attempting download of new url file:///g:/program_test/webapitest/bin/icsharpcode.sharpziplib.dll.
wrn: comparing the assembly name resulted in the mismatch: public key token
err: failed to complete setup of assembly (hr = 0x80131040). probing terminated.

 

解决方案:

1.  修改app.config: 

    添加<startup>

    <supportedruntime version="v4.0" sku=".netframework,version=v4.7.2"/>

     </startup>

2. 查看动态库ufiledev属性“强名称”是否为true,应为false。

  关于强名称的程序集介绍参考