Alex Rivera | Logout

How can I add a Trace() to every method call in C#?

Asked 2009-02-17T23:12:22.090
30

I am having a hard time tracking down a lock issue, so I would like to log every method call's entry and exit. I've done this before with C++ without having to add code to every method. Is this possible with C#?

Edit
Report

1 Answer

1

It might be waiting for the lock issue to take hold, doing a memory dump and analysing the call stack on various threads. You can use DebugDiag or the adplus script (hang mode, in this case) that comes with Debugging Tools for Windows.

Tess Ferrandez also has an excellent lab series on learning to debug various issues using .NET memory dumps. I highly recommend it.

answered 2009-04-24T14:19:25.177

Your Answer