Profile .NET Core Application
(Windows) To profile a .NET Core application
Run dotTrace as a standalone application. The dotTrace Home window will open.
In the left panel, select Profile Local App.
In the middle panel in Profile Application, select .NET Core Application.
In the right panel, in .NET Core Application:
In Application, specify the path to the application executable (if it's a self-contained deployment) or to a library file (if it's a framework-dependent deployment).
Optionally, if your application requires command-line arguments, select Advanced and specify Arguments.
Optionally, if your application creates a number of processes and you want to profile a specific one, select Advanced and Profile child processes. If required, add a process filter as described in the Filtering Child Processes section.
In Profiler Options, specify profiling type. Typically, you should choose between Sampling (evaluate performance and determine slowest methods in your app) and Timeline (determine slowest methods and how method calls are distributed in time).
For more details on profiler options, refer to the Profiler Options section.
Optionally, if you are going to control profiling session (take snapshots, end session, and so on) using the API (rather than the Controller window), select Advanced and Use profiler API. For more details on how to control profiling using the API, refer to the Controlling Profiling Session Through API chapter.
Collect profiling data (snapshots). For more details on how to control profiling session, refer to Controlling Profiling Session (if you control the session manually) or to Controlling Profiling Session Through API (if you control profiling using the API).
After you collect the data, either close the profiled application or detach the profiler using the Detach button of the Controller window. If you use the API to control profiling, detaching must be executed by your code.
(macOS | Linux) To profile a .NET Core application
Download dotTrace command-line profiler.
Depending on the .NET Core version used by the profiled application, run one of the following:
To profile a .NET Core 3.1 application App.exe:./dotTrace.sh start --framework=NetCore --save-to=~/snapshots/snapshot.dtp ~/Projects/MyNetCoreApp/App.exe
To profile a .NET Core 3.0 or earlier application App.exe:./dotTrace.sh start --framework=NetCore --save-to=~/snapshots/snapshot.dtp --support-earlier-net-core ~/Projects/MyNetCoreApp/App.exe