关于“Failed to complete setup of assembly(hr = 0x80131040). Probing terminated”
场景:动态库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。
关于强名称的程序集介绍参考
上一篇: 数字货币资产成避险首选,2019全球数字矿业峰会引期待
下一篇: 蛋白质含量高的食物表文章带你看清楚