拙网论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 123|回复: 0

Unable to debug / set breakpoints in C++/CLI project

[复制链接]

949

主题

1001

帖子

3736

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3736
发表于 2018-10-7 21:26:53 | 显示全部楼层 |阅读模式
https://developercommunity.visua ... n-ccli-project.html

I have several C++/CLI projects, and I've recently upgraded to VS2017. Now whenever I launch the debugger I'm unable to hit any breakpoints, I get a "The breakpoint will not currently be hit. No executable code of the debugger's target code type is associated with this line. Possible causes include: conditional compilation, compiler optimizations, or the target architecture of this line is not supported by the current debugger code type."

If I change the debugger type to Mixed, then I get an error "Unable to start program 'c:\my\program.exe' Mixed-mode debugging is not supported with the legacy managed debug engine."

What's it take to debug C++/CLI code in VS2017?

[size=11.844px]Best Solution
Added a solution by Kim Togo Andersen · 2017年04月26日 06:25

For me, the solution was to checked Options=>Debugging=>General=>Suppress jit optimization on module load
After this, I am able to debug my C++/CLI project.

评论 [url=] 隐藏 1[/url] · 分享

Mark Douglas· 02月02日 12:44 1



Thank you! This solved the problem for me after scratching my head for a while.
Why is this option on by default if it means you can't set breakpoints correctly in managed C++ code? Surely it should default to disabled!





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|抱朴守拙BBS

GMT+8, 2025-5-26 04:20 , Processed in 0.195855 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表