c# - 无法加载 {myassembly} 导入的过程

标签 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.

我的问题是:我如何确定缺少哪个库,因为此时我看不到传递给的值:

mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) + 0x3a bytes    

最佳答案

实际上有一个内置机制用于这些诊断。

(1) 在您的项目属性/调试中,确保选中“启用 native 代码调试”:

enter image description here

(2) 提高 show-loader-snaps flag - 它是 IFEO 中的注册表项,可通过“GlobalFlags”GUI 访问:

enter image description here

(3) 从调试器运行应用程序 - 或者在加载错误之前附加。检查(非常)详细的输出面板。大多数情况下,您可以跳到末尾或查找“ERROR”。

更多详情 here .

关于c# - 无法加载 {myassembly} 导入的过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1945589/

相关文章:

c# - mvc核心中没有引用基础设施的配置服务

c# - 如何在 FluentValidation 的世界中使用带有 ValidateAsync 的规则集?

linux - 如何配置 ddd 以使用另一个 gdb 而不是默认 gdb

c# - 发生异常后在 Visual Studio 调试器中继续

c# - mscorlib.XmlSerializers.DLL 的 FileNotFoundException,它不存在

WPF - 不再使用 <?Mapping > 了吗?

c# - MVC : Component gets rendered, 中的 Blazor 但 @onclick 不工作。连接问题

javascript - 如何在 angular2 的移动模拟器中显示 console.log

c# - 你能为强命名程序集创建 "weak"程序集引用吗

c# - 如何将 session 数据从 Controller 传递到 View (MVC)