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

后端 未结 6 1593
忘掉有多难
忘掉有多难 2020-11-28 11:47

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

6条回答
  •  广开言路
    2020-11-28 12:32

    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.

提交回复
热议问题