.NET: Is it possible to register calls to .NET assembly methods?

Is it possible to register calls to .NET methods executed while the application is running?

+4
source share
4 answers

Perhpas is interested in one of the following options:

  • Use an existing profiler to visualize calls to .NET methods. It depends on the profiler and their functionality, but ANTS or DotTrace work just fine, unless you need something completely special.

  • If you are interested in a low-level implementation, including the state of the heap at the time of the call, you might be interested in WinDBG + Sos and its trace parameters (wt command). Just set breakpoints in WinDbg, run the application and collect traces, including low level calls.

  • If there is an implicit log requirement, you can use the .NET profiling API (C ++) and register whatever you want or profile the API from the dotTrace (C #) profiler (it comes with dotTrace).

    Hope this helps.

+1
source

Yes. I usually use this: http://www.jetbrains.com/profiler/ (there is a free trial version there).

+1
source

yes use postsharp . In the Getting Started tutorial, he pretty much tells you how to do what you want. Using postsharp, you can "register" method calls in any third-party side assembly.

+1
source

Craig

You can try Runtime Flow (developed by me). This is a new product and cannot, for example, use the functions of the catch function, but its main purpose is to log calls to .NET methods that are executed while the application is running.

Currently, Runtime Flow works best with source code, but can be configured to monitor DLLs without source code.

+1
source

Source: https://habr.com/ru/post/1308425/


All Articles