我有一个 ASP.NET WebApplication (.NET 4.0/C#),它与外部 COM dll(用 C++ 编写)一起工作。
在与旧的 ASP 项目完美配合的函数调用中,我在 DLL 代码中收到 AccessViolationException。
为了调试它,我向编写它的同事请求了 DLL 的调试版本。不过,我无法直接访问 dll 项目或源代码。
如何使用此调试 dll 找出错误发生的位置?我找不到进入我正在调用的方法的方法。可能吗?
编辑:我也有 .pdb 文件,如果有的话。出于某种原因,我在 Debug->Windows->Modules 概览中看不到 COM dll。我真的卡住了,感谢任何帮助。
请您参考如下方法:
您需要启用非托管代码调试。
来自 MSDN :
The Unmanaged code debugging property, available on the Debug page of the Project Designer, determines whether debugging of native code is supported. Select this option if you are making calls to COM objects, or if you start a custom program written in native code that calls your project and you need to debug the native code.
对于 ASP,您需要在“Web”选项卡的“调试器”部分选中“ native 代码”。
此外,您还应该在调试选项中禁用Just My Code debugging。
