public static void Attach()

in JetBrains.Profiler.SelfApi/src/DotTrace.cs [246:266]


    public static void Attach(Config config)
    {
      if (config == null)
        throw new ArgumentNullException(nameof(config));

      Helper.CheckAttachCompatibility();
      Helper.CheckSamplingCompatibility();

      lock (Mutex)
      {
        ConsoleRunnerPackage.VerifyReady();

        if (_session != null)
          throw new InvalidOperationException("The profiling session is active still: forgot to call Detach()?");

        _collectedSnapshots = null;
        _deletedIndexFiles = new HashSet<string>();
        _packedInZipCount = 0;
        _session = RunProfiler(config).AwaitConnected();
      }
    }