in JetBrains.Profiler.SelfApi/src/DotMemory.cs [284:300]
public static string Detach()
{
lock (Mutex)
{
if (_session == null)
throw new InvalidOperationException("The profiling session isn't active: forgot to call Attach()?");
try
{
return _session.Detach().AwaitFinished().WorkspaceFile;
}
finally
{
_session = null;
}
}
}