Tracing framework code

  • Thread starter Thread starter Maxim
  • Start date Start date
M

Maxim

Hello, everybody.

Can I trace framework code while debugging my application. For example I'd
like to find out how BindingSource processes OnChange event because I'm
experiencing problems with it and I don't understand how it works exactly.
Can I set a breakpoint to catch the moment, when BindingSource changes its
Current property, or probably there are other ways to trace its behaviour
under debugger?

Thanks in advance.
 
Hi Maxim,

You've asked for a mouthful, there. The .Net Tracing mechanisms are highly
extensible. Of course, this adds a bit to their complexity. But you can do
all kinds of variations of tracing, using several classes in the
System.Diagnostics Namespace.

Here are a couple of good articles to get you started:
http://www.15seconds.com/issue/020910.htm
http://www.codeguru.com/Csharp/.NET/net_general/netframeworkclasses/article.php/c8373/

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Orange you bland I stopped splaying bananas?
 
Maxim said:
Can I trace framework code while debugging my application.

I don't know of any way to step into the code short of using an unmanaged
debugger.

The easiest solution is to download Reflector, and look at the Microsoft
code. Load in the System.Windows.Forms assembly, find the class you're
looking for, and take a long look through theOnChange Event. Reflector has
excellent features for doing this.
 
Hello Chris,
The easiest solution is to download Reflector, and look at the
Microsoft code. Load in the System.Windows.Forms assembly, find the
class you're looking for, and take a long look through theOnChange
Event. Reflector has excellent features for doing this.

In addition, Reflector lets you drill into methods. Just click on the underlined
method like a hyperlink and it will drill in through the method calls. It
doesn't allow you to see the variable values, but you can get an idea of
what's going on at least. I continue to be amazed by the amount of code MSFT
allows us to see if we're willing to put in a little work.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
 
Back
Top