Debug any entry point

I am working with BasePageClass which comes from System.Web.UI.Page.

What I would like to do is to somehow set a breakpoint for every single method that a method or property accesses on this page.

The only way I know how to do this is to set a breakpoint for every property and method on the page. It just doesn't seem practical.

Does anyone know if there is a way to just say "whenever this page executes the code on this page?"

0


source to share


2 answers


System.Diagnostics.Debugger.Break()

"If the debugger is not connected, users are asked if they want to attach the debugger. If so, the debugger is running. If the debugger is connected, the debugger is signaled by a user interrupt event, and the debugger pauses the process as if the debugger breakpoint had been removed."



- http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx

Take a look at this, you can use it in conjunction with BasePage or some other goodness.

+1


source


Not really sure about that ...



But I think that when you use conditional breakpoints in Visual Studio, you can pretty much set a breakpoint to evaluate any expression you can write in .Net. Maybe try writing Reflection code that checks if a property or method was called, and then set a breakpoint condition to evaluate that code.

0


source







All Articles