c++/WinRT 组件代码中的断点未触发 [英] The break point in c++/WinRT Component code is not triggered
问题描述
我正在尝试将 macOS 应用迁移到 UWP
I am trying to migrate a macOS app to UWP
有一些c++代码需要重用,我把它们放在一个WinRT/c++组件中.
there are some c++ code need to be reused, I put them in a WinRT/c++ component.
然后我将它添加到 UWP 应用程序的程序集引用并将其设置为混合调试类型.我在 c++/WinRT 组件代码中设置断点并重建项目.
then I add it to the assembly reference of the UWP app and set it to mixed debug type. I set the breakpoint in the c++/WinRT component code and rebuild the project.
最近,我打开UWP应用程序并构建/运行并调用WinRT/C++组件,一切正常,只是没有触发c++代码中的断点
Lately, I open the UWP app and build/run and call the WinRT/C++ component, everything is ok except the breakpoint in c++ code is not triggered
欢迎您的评论
-----------------------------------更新问题(2020 年 10 月 5 日)
----------------------------------updated question(Oct 5, 2020)
我尝试创建一个简单的组件并添加到一个空白的 c# 应用程序它可以正常工作并正确调用组件.但是还是不能触发WinRT/c++代码中的断点
I try to create a simple component and add to a blank c# app it works and calls the component correctly. but still can not trigger the breakpoint in WinRT/c++ code
-----------------------------------更新问题(2020 年 10 月 4 日)
----------------------------------updated question(Oct 4, 2020)
c++/WinRT 组件
c# 应用
-----------------------------------更新问题(2020 年 10 月 3 日)WinRT/C++ 组件代码断点
----------------------------------updated question(Oct 3, 2020) WinRT/C++ component code breakpoint
新项目只需调用 WinRT/C++ 组件
a new project simply call the WinRT/C++ component
推荐答案
这是@YanGu - MSFT 的答案
this is the answer from @YanGu - MSFT
如果要在 C++/WinRT 组件中触发断点,组件项目应该与 UWP 应用在同一个解决方案中.然后将调试器类型设置为 Mixed(Managed and Native)
If you want to trigger a break point in your C++/WinRT Component, the component project should be in the same solution as the UWP app. Then set the debugger type as Mixed(Managed and Native)
这篇关于c++/WinRT 组件代码中的断点未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!