in JetBrains.Profiler.SelfApi/src/DotMemory.cs [262:278]
public static void Attach(Config config)
{
if (config == null)
throw new ArgumentNullException(nameof(config));
Helper.CheckAttachCompatibility();
lock (Mutex)
{
ConsoleRunnerPackage.VerifyReady();
if (_session != null)
throw new InvalidOperationException("The profiling session is active still: forgot to call Detach()?");
_session = RunConsole("attach", config).AwaitConnected();
}
}