Prevent method from being debugged

  • Thread starter Thread starter ramadu
  • Start date Start date
R

ramadu

Hi,

I have a utility method in one of my applications which is used
extensively across the application (and it works well). The problem is
that while debugging using Visual Studio, I sometimes forget to skip
debugging for that method (i.e. press F10 instead of F11) and I end up
debugging into that method. Is there any attribute or condition that I
can specify by which I can skip debugging into this utility function?

- Sri
 
Decorate the member with
System.Diagnostics.DebuggerStepThroughAttribute.

HTH,

Sam
 
That worked! Thanks!

-Sri
Decorate the member with
System.Diagnostics.DebuggerStepThroughAttribute.

HTH,

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
 
Hi,
Hi,

I have a utility method in one of my applications which is used
extensively across the application (and it works well). The problem is
that while debugging using Visual Studio, I sometimes forget to skip
debugging for that method (i.e. press F10 instead of F11) and I end up
debugging into that method. Is there any attribute or condition that I
can specify by which I can skip debugging into this utility function?

- Sri

Additionally to Samuel's answer, when that happens, you can also press
the "Step out" button (Shift-F11 in default configuration). That will
take you right out of the current method.

HTH,
Laurent
 
I use that one alot, but I also use "DebuggerHidden" alot. The difference
(that I observe) is the interaction with Exceptions and "Break on All
exceptions". There are also some breakpoint differences.

In low level code that often gets exceptions (such as calling dispose on a
socket), I would use DebuggerHidden.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top