Blu*_*rin 23 c# debugging assemblies
当运行prorgam时,我似乎错过了一个库,当我启动项目的输出时,我在启动时遇到异常.
A first chance exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll
An unhandled exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll
Additional information: A procedure imported by 'my assembly, Version=xx.1.1.0, Culture=neutral, PublicKeyToken=7292581204d9e04a' could not be loaded.
'ScriptX.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', No symbols loaded.
Run Code Online (Sandbox Code Playgroud)
我的问题是:如何确定哪个库丢失,因为此时我无法看到传递给的值:
mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) + 0x3a bytes
Run Code Online (Sandbox Code Playgroud)
Ofe*_*lon 23
事实上,只有这些诊断的内置机制.
(1)在项目属性/ Debug中,确保选中"启用本机代码调试":

(2)提升show-loader-snaps标志 - 它是IFEO中的注册表键,可通过'GlobalFlags'GUI访问:

(3)运行应用程序并检查(非常)详细的输出窗格.你可以大多跳到最后或寻找'错误'.
更多细节在这里.
为AppDomain.AssemblyResolve事件实现一个处理程序。它使用ResolveEventArgs.Name告诉您要查找哪个程序集。如果仅是要对此特定程序集进行故障排除,请使用Fuslogvw.exe。如果挂断是非托管程序集,则DependencyWalker的Profile选项可以向您显示LoadLibrary()调用失败的原因。SysInternals的ProcMon也可以使用,但噪音很大。
| 归档时间: |
|
| 查看次数: |
22837 次 |
| 最近记录: |