Ronnie Overby Ronnie Overby - 3 years ago 228
ASP.NET (C#) Question

How do you debug HTTPHandler

I have set a breakpoint in an HttpHandler in visual studio. The HttpHandler is an .ashx file I am trying to debug by running my application in the VS development web server. My breakpoint is not getting hit.

How can I step through it?

Edit: My breakpoint is not getting hit

Answer Source

Open the handler file in Visual Studio and place the breakpoint as you said. Then load the web application in your browser (starting your application in debug-mode of course). If the breakpoint remains gray and doesn't turn filled black, then your handler is probably not registered appropriately in your webapp. That's mostly the issue. If according to you everything is fine, try doing a clean + rebuild of your entire solution. And set your project as startup project(if you're using multiple projects). Often that helps already.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download