我的C#应用程序在Visual输出窗口中看到了很多EEFileLoadException。我不知道如何获得这个异常的任何具体细节。有很多这样的情况,当它们发生时,它们似乎消耗了大量的运行时。
,特别是我想知道的是,哪些文件未能加载.
如果我打开Visual设置"C++异常,<不在此list>中的所有C++异常“,则调试器实际上将中断异常,但没有有用的详细信息。它表明:

没有其他细节我能找到..。这个弹出窗口和我在IDE中知道的其他任何东西都不会显示更多的细节(不像如果它是.NET异常)。
试图获取有关异常的信息:
$exception不起作用(即使在IDE标记异常时也无法识别)。"Microsoft.VisualStudio.Debugger.Runtime.Desktop.dll",尽管我无法很容易地判断它是否被找到或加载成功。但是由于这个文件在加载它的位置上存在,所以这可能是无关的。我看不出还有什么有用的。我的应用程序是这样构造的:
调试时,实际上运行的是VB6 IDE,而不是已编译的EXE。然后,VB6代码在不同的点调用回C#代码。当这种情况发生时,就会出现这些例外情况。
异常发生在各种WPF InitializeComponent()调用过程中。它不会直接出现在我自己的代码中。
输出窗口中的异常如下所示:
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: EEFileLoadException at memory location 0x0019663C.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: EEFileLoadException at memory location 0x00195E64.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: EEFileLoadException at memory location 0x0019699C.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x74D42802 in VB6.EXE: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
...(更多的是.继续进行)。注意,VB6.EXE是进程名,这是因为我在IDE中运行的方式,如前所述。实际上,VB6本身并不会产生这些异常。它们只在调用InitializeComponent()时才会发生。
如果忽略异常,应用程序实际上运行良好。因此,这可能只是调试环境中的一个问题。但我还是想弄清楚真相。
发布于 2021-07-22 14:47:34
这不是一个完整的答案,但至少是一个解决办法。
调试器处理这些异常的根本原因是,我一直在处理一个引用C++/CLI项目的C#项目,并且需要调试到后者调用的C++代码。所以我启用了混合模式调试。
关闭它可以消除异常--至少在调试器不再关心它们的意义上是这样。我想(?)他们可能还在幕后发生。
VS 如下所示的以下特性:

当然,当我再次需要混合模式时,我将不得不打开它,并忍受异常的性能下降。但至少对我来说大部分时间都是个进步。
https://stackoverflow.com/questions/68458232
复制相似问题