visual-studio 如何在调试时从 C# 应用程序进入 C/C++ DLL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/765481/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:23:11  来源:igfitidea点击:

How to step into C/C++ DLL from C# application while debugging

.netvisual-studiovisual-c++visual-studio-debuggingstep-into

提问by abatishchev

I have two project in my solution: C/C++ Win32 DLL and some C# application.

我的解决方案中有两个项目:C/C++ Win32 DLL 和一些 C# 应用程序。

What I have to do to be able to step into DLL while debugging?

我必须做什么才能在调试时进入 DLL?

I switched on all debugging options in C++ project's settings and copied to C# application root next files: MyLib.dll, MyLib.pdb, vc90.pdb, vc90.idb, but it doesn't helped.

我打开了 C++ 项目设置中的所有调试选项,并将下一个文件复制到 C# 应用程序根目录:MyLib.dll、MyLib.pdb、vc90.pdb、vc90.idb,但它没有帮助。

What additional actions have I to carry out?

我还需要执行哪些额外的操作?

回答by billb

Have you turned on Enable Unmanaged Code Debugging in your C# project?

您是否在 C# 项目中启用了启用非托管代码调试?

回答by ikh

If you are attaching a debugger through Debug > Attach To Process, before clicking "Attach" in the "Attach to Process" dialog, make sure to select the appropriate code typeto which the debugger can be attached.

如果您通过Debug > Attach To Process 附加调试器,则在单击“附加到进程”对话框中的“附加”之前,请确保选择可以附加调试器的适当代码类型

enter image description here

在此处输入图片说明