Reading assembly binding log files (Fusion Log)
https://indexoutofrange.com/Could_not_load_file_or_assembly_or_one_of_its_dependencies/
Reading assembly binding log files (Fusion Log)
This is my preferred way to diagnose. After dealing with many Microsoft loggs, I think the assembly binding ones are the best ones. The files are named using a pattern like this:
[assembly name], Version=[assembly version], Culture=[culture], PublicKeyToken=[public token]
so for NLog we will have:
NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c
The best way to understand how .NET runtime loads assemblies let’s look at the logs.
The operation completed successfully.
First an easy one - the one that succeeded.
The operation failed.
Now for something harder, but more interesting. A failed log file. Also for NLog.
Troubleshooting FusionLog
I don’t see the logs from my application
The application has to be restarted after enabling the log. When talking about IIS application the whole IIS process has to be restarted.
I don’t see the folder
You have to create the folder manually
The application runs slower
The logging adds some overhead, but not enough for it to be seen with a bare eye. Maybe You are doing a lot of dynamic assembly loading?
Something is eating up my disc space
Disable the log. When enabled it creates a lot of small files. The result is that they are taking up more disc space than they actual size.
The logs are still being created despite disabling the logging
Restart the application process.
Why is it called fusion log?
I suspect because fusion is the process of combining two atoms into one.
实例分析
*** Assembly Binder Log Entry (4/30/2020 @ 10:55:30 AM) *** The operation failed. Bind result: hr = 0x80131040. No description available. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable c:\windows\system32\inetsrv\w3wp.exe --- A detailed error log follows. === Pre-bind state information === LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73 (Fully-specified) LOG: Appbase = file:///D:/Project/IN_LS_CMS_WDAL/ LOG: Initial PrivatePath = D:\Project\IN_LS_CMS_WDAL\bin LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\in_ls_cms_wdal\e4b0d765 LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\in_ls_cms_wdal\e4b0d765 LOG: AppName = 214332ee Calling assembly : CMS.IO, Version=7.0.5354.21097, Culture=neutral, PublicKeyToken=834b12a258f213f9. 所以是CMS.IO调用了ICSharpCode.SharpZipLib === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\Project\IN_LS_CMS_WDAL\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.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73 LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/in_ls_cms_wdal/e4b0d765/214332ee/ICSharpCode.SharpZipLib.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/in_ls_cms_wdal/e4b0d765/214332ee/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.DLL. LOG: Attempting download of new URL file:///D:/Project/IN_LS_CMS_WDAL/bin/ICSharpCode.SharpZipLib.DLL. LOG: Assembly download was successful. Attempting setup of file: D:\Project\IN_LS_CMS_WDAL\bin\ICSharpCode.SharpZipLib.dll LOG: Entering download cache setup phase. LOG: Assembly Name is: ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73 WRN: Comparing the assembly name resulted in the mismatch: Minor Version ERR: The assembly reference did not match the assembly definition found. ERR: Setup failed with hr = 0x80131040. ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
*** Assembly Binder Log Entry (4/30/2020 @ 10:55:30 AM) *** The operation failed. Bind result: hr = 0x80131040. No description available. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable c:\windows\system32\inetsrv\w3wp.exe --- A detailed error log follows. === Pre-bind state information === LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73 (Fully-specified) LOG: Appbase = file:///D:/Project/IN_LS_CMS_WDAL/ LOG: Initial PrivatePath = D:\Project\IN_LS_CMS_WDAL\bin LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\in_ls_cms_wdal\e4b0d765 LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\in_ls_cms_wdal\e4b0d765 LOG: AppName = 214332ee Calling assembly : CMS.IO, Version=7.0.5354.21097, Culture=neutral, PublicKeyToken=834b12a258f213f9. === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\Project\IN_LS_CMS_WDAL\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.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73 LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/in_ls_cms_wdal/e4b0d765/214332ee/ICSharpCode.SharpZipLib.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/in_ls_cms_wdal/e4b0d765/214332ee/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.DLL. LOG: Attempting download of new URL file:///D:/Project/IN_LS_CMS_WDAL/bin/ICSharpCode.SharpZipLib.DLL. LOG: Assembly download was successful. Attempting setup of file: D:\Project\IN_LS_CMS_WDAL\bin\ICSharpCode.SharpZipLib.dll LOG: Entering download cache setup phase. LOG: Assembly Name is: ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73 WRN: Comparing the assembly name resulted in the mismatch: Minor Version ERR: The assembly reference did not match the assembly definition found. ERR: Setup failed with hr = 0x80131040. ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
ICSharpCode.SharpZipLib
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2019-04-30 GEEK UNINSTALLER
2015-04-30 ConcurrentDictionary<TKey, TValue>的AddOrUpdate方法