如何使用Visual Studio 2017从asp.net调试本机C ++调用

时间:2022-09-01 23:43:16

I have an asp.net web application (.NET Framework) by Visual C#, and this web application uses native C++ DLL by DllImport. The native C++ DLL project is also part of the solution. However when I do the debugging, and try to step into the native C++ code, it fails, the breakpoint on the C++ code shows "the breakpoint will not currently be hit no symbols have been loaded".

我有一个Visual C#的asp.net Web应用程序(.NET Framework),这个Web应用程序使用DllImport的本机C ++ DLL。本机C ++ DLL项目也是解决方案的一部分。但是当我进行调试并尝试进入本机C ++代码时,它失败了,C ++代码上的断点显示“当前没有命中断点,没有加载符号”。

1 个解决方案

#1


0  

The solution is : make sure The "Native Code" check box (Project>Property>Web>Debugger>native code) as shown on the picture is checked. By default it is unchecked when the .net project is created.

解决方案是:确保选中图片中显示的“本机代码”复选框(项目>属性> Web>调试器>本机代码)。默认情况下,在创建.net项目时取消选中它。

I spent whole morning to find out cause, and it is not mentioned in * and other website, therefore would like to share the solution.

我花了一整个上午才找到原因,并没有在*和其他网站上提及,因此想分享解决方案。

如何使用Visual Studio 2017从asp.net调试本机C ++调用

//Follow Jack's suggestion to post the solution as an answer, instead of putting it as part of the question. Thanks Jack.

//按照杰克的建议将解决方案作为答案发布,而不是将其作为问题的一部分。谢谢杰克。

#1


0  

The solution is : make sure The "Native Code" check box (Project>Property>Web>Debugger>native code) as shown on the picture is checked. By default it is unchecked when the .net project is created.

解决方案是:确保选中图片中显示的“本机代码”复选框(项目>属性> Web>调试器>本机代码)。默认情况下,在创建.net项目时取消选中它。

I spent whole morning to find out cause, and it is not mentioned in * and other website, therefore would like to share the solution.

我花了一整个上午才找到原因,并没有在*和其他网站上提及,因此想分享解决方案。

如何使用Visual Studio 2017从asp.net调试本机C ++调用

//Follow Jack's suggestion to post the solution as an answer, instead of putting it as part of the question. Thanks Jack.

//按照杰克的建议将解决方案作为答案发布,而不是将其作为问题的一部分。谢谢杰克。