{"record":{"id":"03f37c2e848475ba","repo":"dotnet/BenchmarkDotNet","slug":"field-consolerunnerpackage-not-found-03f37c","errorCode":null,"errorMessage":"Field 'ConsoleRunnerPackage' not found.","messagePattern":"Field 'ConsoleRunnerPackage' not found\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs","lineNumber":55,"sourceCode":"        DotTrace.StopCollectingData();\n        DotTrace.SaveData();\n    }\n\n    protected override void Detach()\n    {\n        DotTrace.Detach();\n    }\n\n    protected override string CreateSnapshotFilePath(DiagnoserActionParameters parameters)\n    {\n        return ArtifactFileNameHelper.GetFilePath(parameters, \"snapshots\", DateTime.Now, \"dtp\", \".0000\".Length);\n    }\n\n    protected override string GetRunnerPath()\n    {\n        var consoleRunnerPackageField = typeof(DotTrace).GetField(\"ConsoleRunnerPackage\", BindingFlags.NonPublic | BindingFlags.Static);\n        if (consoleRunnerPackageField == null)\n            throw new InvalidOperationException(\"Field 'ConsoleRunnerPackage' not found.\");\n\n        object? consoleRunnerPackage = consoleRunnerPackageField.GetValue(null);\n        if (consoleRunnerPackage == null)\n            throw new InvalidOperationException(\"Unable to get value of 'ConsoleRunnerPackage'.\");\n\n        var consoleRunnerPackageType = consoleRunnerPackage.GetType();\n        var getRunnerPathMethod = consoleRunnerPackageType.GetMethod(\"GetRunnerPath\");\n        if (getRunnerPathMethod == null)\n            throw new InvalidOperationException(\"Method 'GetRunnerPath' not found.\");\n\n        string? runnerPath = getRunnerPathMethod.Invoke(consoleRunnerPackage, null) as string;\n        if (runnerPath == null)\n            throw new InvalidOperationException(\"Unable to invoke 'GetRunnerPath'.\");\n\n        return runnerPath;\n    }\n\n    internal override bool IsSupported(RuntimeMoniker runtimeMoniker)","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs#L37-L73","documentation":"DotTraceDiagnoser.GetRunnerPath mirrors the dotMemory one: it reflects into JetBrains.Profiler.SelfApi's DotTrace type for the private static 'ConsoleRunnerPackage' field. Thrown when that field is absent, i.e. the loaded SelfApi layout differs from what this BDN build expects.","triggerScenarios":"The JetBrains.Profiler.SelfApi assembly resolved at runtime (via InitAsync download or NuGet) is a version where DotTrace's ConsoleRunnerPackage field was renamed/removed/moved. Same breakage class as the dotMemory equivalent.","commonSituations":"Independently upgrading the dotTrace SelfApi dependency; cached prerequisite from a different build; insider/preview JetBrains profiler build with refactored internals.","solutions":["Keep the JetBrains.Profiler.SelfApi version aligned with the one referenced by your BenchmarkDotNet.Diagnostics.dotTrace build.","Clear the cached prerequisite so InitAsync re-fetches the matching package.","Upgrade BenchmarkDotNet to a release matching your SelfApi layout."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* use dotTrace diagnoser */ }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"ConsoleRunnerPackage\"))\n{\n    log.Error(\"dotTrace SelfApi layout mismatch - align JetBrains.Profiler.SelfApi version with your BDN build.\");\n}","preventionTips":["Do not upgrade JetBrains.Profiler.SelfApi independently of BenchmarkDotNet.","Clear the prerequisite cache after a BDN upgrade.","Pin the SelfApi version declared by the BDN dotTrace diagnoser package."],"tags":["benchmarkdotnet","dottrace","jetbrains","reflection","version-mismatch","profiler"],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}