在 Silverlight 5 应用程序中调试 Native .dll
我正在编写一个 Silverlight 应用程序,该应用程序利用了 Silverlight 5 中添加的 P/Invoke 功能。我编写了一个本机 .dll,它从托管代码中获取位图并使用第 3 方库 (OpenCV) 来处理它。
我的 .dll 已正确加载并且工作正常,但我无法命中我在本机代码中任何位置设置的任何断点。 Visual Studio 表示不会命中断点,因为没有为文档加载任何符号。我尝试将相应的 .pdb 文件复制到加载 .dll 的路径,但没有帮助。此外,调试时 .dll 不会显示在“模块”窗口中,因此我无法以这种方式手动加载符号。
还有其他方法可以让调试器加载所需的符号吗?
I am writing a Silverlight application that takes advantage of the P/Invoke functionality added to Silverlight 5. I've written a native .dll that takes a bitmap from the managed code and uses a 3rd party library (OpenCV) to process it.
My .dll gets loaded correctly and works fine, but I am not able to hit any breakpoints I set anywhere in the Native code. Visual Studio says that the breakpoint will not be hit as there are no symbols loaded for the document. I tried copying the corresponding .pdb files to the path where the .dll is loaded from, but it didn't help. Additionally, the .dll doesn't show up in the Modules window when debugging, so I can't manually load the symbols that way.
Is there any other way to get the debugger to load the needed symbols?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您启动 SL5 应用程序时,VS 会启动 .NET 调试器。此调试器无法调试本机进程。
您可以启动 Visual Studio 的另一个实例,并使用调试菜单下的“附加到进程”对话框,并将本机调试器附加到目标进程。请注意,我不确定您是否可以在同一进程上同时附加 Native 和 .NET 调试器。
When you start a SL5 app, VS starts a .NET debugger. This debugger is unable to debug native processes.
You could start another instance of Visual Studio, and use the "Attach to process" dialog under the debug menu, and attach the native debugger to the targeted process. Note that I am not sure that you can attach a Native and a .NET debugger at the same time on the same process.