'dotTrace API profiling not saving snapshots
I am trying to profile a method using the JetBrains Profiler API (JetBrains.Profiler.Api 1.1.8). The workflow is:
- launch application
- get application to a point where I want to profile
- launch dotTrace and start it with the following settings

- the profiling task bar shows that the session is running
I have tried both of the following code snippets
MeasureProfiler.StartCollectingData();
SomeLongRunningMethod();
MeasureProfiler.SaveData();
.
..
...
MeasureProfiler.StartCollectingData();
SomeLongRunningMethod();
MeasureProfiler.StopCollectingData();
MeasureProfiler.SaveData();
the method executes but I can't see the snapshot anywhere on disk or in dotTrace snapshots. What am I missing?
Solution 1:[1]
Could you please try to do these steps:
- Open %localappdata%\JetBrains\Shared\vAny\dotTrace\
- Find recentSnapshots.model file
- Rename this file
- Reproduce your profiling scenario
Do collected snapshots appear in the Recent Snapshots list?
Follow these steps to open previously collected snapshots:
- Click "Open Snapshot..." in dotTrace Home
- Find snapshot in storage location folder (you can find the path in Settings | Storage location)
- Choose *.tmp file and open it (example)
Solution 2:[2]
If you are like me and stumble across here, wondering why API isn't working even though you set up dottrace, make sure you have set it to using the API and not manually!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Valentina Serbakova |
| Solution 2 | eenNaampje |

