使用本机C ++,托管c ++ cli和c#解决方案以混合模式调试 [英] debugging in mixed mode with native C++, managed c++ cli, and c# solution

查看:955
本文介绍了使用本机C ++,托管c ++ cli和c#解决方案以混合模式调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多线程项目工作,启动项目设置为一个c#项目,运行我的用户界面。然后有一系列底层c ++本地项目,通过托管C ++ / CLI项目连接到C#。我已经启用了c#启动项目启用非托管调试,当我尝试调试本机代码,我能够打破我设置的断点。然而,它挂起,我试图再次运行它,并尝试再次打破一个断点。例如,如果我有一个循环,我试图在每次迭代中打它,在第二次迭代后,程序挂起,我不得不强制退出。在Visual Studio 2010中工作。调试开始证明不太有用的速度,有没有办法排除这个问题?

I have a multithreaded project im working on and the startup project is set to a c# project that runs my UI. Then there is a whole series of underlying c++ native projects which are connected to the C# by managed C++/CLI projects. I've enabled in the c# start up project 'Enable Unmanaged debug' and when I attempt to debug the native code, I am able to hit break points I set. However, it hangs after I try to run it again and try to hit a break point again. For example, if I have a loop I try to hit inside it in each iteration, after the second iteration the program hangs and I have to force quit. Im working in Visual Studio 2010. Debugging beginning to prove not too useful at this rate, is there any way to preclude this problem?

推荐答案

p>当我要调试本地代码以及C ++ / CLI时,我执行以下操作:

When I want to debug native code as well as C++/CLI, I do following:


  1. 在C#应用程序中, $ c>在构建选项卡中允许不安全代码,并在项目属性的调试选项卡中启用启用非托管代码调试

  2. 对于C ++ / CLI dll项目,在属性的调试选项卡中,将调试器类型设置为混合

  1. In C# application, check Allow unsafe code in Build tab and Enable unmanaged code debugging in Debug tab of project properties.
  2. For C++/CLI dll project, In Debugging tab of properties, set Debugger Type to Mixed

这篇关于使用本机C ++,托管c ++ cli和c#解决方案以混合模式调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆