简体   繁体   English

如何在VS 2010中附加调试IIS本机模块

[英]How to attach debug IIS native module with VS 2010

I am getting difficulty debugging my custom IIS module written in C++, using VS 2010. The problem is that IIS worker process (w3wp.exe) starts too quickly and there is no way to catch it at the beginning in VS "attach to process" dialog. 我在使用VS 2010调试用C ++编写的自定义IIS模块时遇到了困难。问题是IIS工作进程(w3wp.exe)启动太快,并且无法在VS的“开始附加到进程”中捕获它。对话。 Is there a good skill to do this? 有一个好的技巧可以做到这一点吗? Thanks. 谢谢。

You can add a Debugger Breakpoint in your code . 您可以在代码中添加调试器断点 I use this all the time to catch things that are too fast to catch manually. 我一直都用它来捕捉那些无法手动捕捉的东西。

FYi in .net you use System.Diagnostics.Debugger.Break() to achieve the same effect. .NET中的FYi使用System.Diagnostics.Debugger.Break()来达到相同的效果。

It causes the windows system debugger to be activated. 这将导致Windows系统调试器被激活。

我有时使用的一个技巧是在代码的入口点引入一个人工无限循环,然后在此循环中设置一个断点,并在命中断点时将下一条指令移出该循环-完成工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM