{"record":{"id":"5ae87d66f568c376","repo":"microsoft/aspire","slug":"the-cli-bundle-layout-was-found-but-the-dashboard-binary","errorCode":null,"errorMessage":"The CLI bundle layout was found, but the dashboard binary (aspire-managed) is missing. The bundle may be corrupted or incomplete. Run 'aspire setup --force' to re-extract the bundle, or reinstall the Aspire CLI.","messagePattern":"The CLI bundle layout was found, but the dashboard binary \\(aspire-managed\\) is missing\\. The bundle may be corrupted or incomplete\\. Run 'aspire setup --force' to re-extract the bundle, or reinstall the Aspire CLI\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Profiling/ProfileCaptureService.cs","lineNumber":79,"sourceCode":"\n        var managedPath = ResolveManagedPathOverride(configuration);\n        BundleLayoutLease? layoutLease = null;\n        if (managedPath is null)\n        {\n            layoutLease = await bundleService.EnsureExtractedAndAcquireLayoutAsync(\"cli\", \"profile-dashboard\", cancellationToken).ConfigureAwait(false);\n            var layout = layoutLease?.Layout;\n            managedPath = layout?.GetManagedPath();\n        }\n\n        // `ASPIRE_REPO_ROOT` is the shared opt-in for repo-local assets. Avoid independently\n        // walking from the command directory or process path here, because installed CLIs should not\n        // accidentally bind to a nearby checkout while profiling unrelated applications.\n        managedPath ??= ResolveRepoLocalManagedPath(configuration[BundleDiscovery.RepoRootEnvVar]);\n\n        if (managedPath is null || !File.Exists(managedPath))\n        {\n            layoutLease?.Dispose();\n            throw new InvalidOperationException(DashboardCommandStrings.ManagedBinaryNotFound);\n        }\n\n        var outputCollector = new OutputCollector(fileLoggerProvider, \"ProfileDashboard\");\n        var dashboardArgs = new[]\n        {\n            \"dashboard\",\n            $\"--{KnownAspNetCoreConfigNames.Urls}={options.DashboardUrl}\",\n            $\"--{KnownConfigNames.DashboardOtlpGrpcEndpointUrl}={options.OtlpGrpcUrl}\",\n            $\"--{KnownConfigNames.DashboardOtlpHttpEndpointUrl}={options.OtlpHttpUrl}\",\n            $\"--{KnownConfigNames.DashboardUnsecuredAllowAnonymous}=true\",\n            $\"--{KnownConfigNames.DashboardApiEnabled}=true\"\n        };\n\n        var processOptions = new ProcessInvocationOptions\n        {\n            StandardOutputCallback = outputCollector.AppendOutput,\n            StandardErrorCallback = outputCollector.AppendError\n        };","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Profiling/ProfileCaptureService.cs#L61-L97","documentation":"Before profiling, ProfileCaptureService.StartAsync locates the aspire-managed (dashboard) binary from the CLI bundle layout, an ASPIRE_REPO_ROOT repo-local override, or the managed-path environment override. This error is thrown when none of those resolve to an existing file. The CLI considers the bundle corrupted or incomplete and refuses to continue so profiling does not silently bind to the wrong binary.","triggerScenarios":"Running a profiling capture (e.g. 'aspire ... --capture-profile') when: the bundle layout lease's GetManagedPath() returns a non-existent path, the ASPIRE_REPO_ROOT env var points at a checkout without the binary, or the managed-path override env var points to a missing file.","commonSituations":"Partial or corrupted CLI bundle extraction; user deleted bundle cache directories; ASPIRE_REPO_ROOT pointing to a repo without a built aspire-managed binary; stale environment override variables left over from earlier experiments; interrupted 'aspire setup' leaving an incomplete bundle.","solutions":["Run 'aspire setup --force' to re-extract a complete CLI bundle.","Reinstall the Aspire CLI if re-extraction does not restore aspire-managed.","Unset or correct the managed-path / ASPIRE_REPO_ROOT environment overrides so they point to a real binary (or remove them to use the default bundle).","If using a repo-local setup, build the dashboard binary in that repo before profiling."],"exampleFix":"// before: stale override pointing at missing binary\nexport ASPIRE_REPO_ROOT=/old/checkout\n// after: remove the override and re-extract the bundle\nunset ASPIRE_REPO_ROOT\naspire setup --force","handlingStrategy":"validation","validationCode":"// Run before requesting a profile capture\nvar managedPath = Environment.GetEnvironmentVariable(\"ASPIRE_REPO_ROOT\") is string root\n    ? Path.Combine(root, \"artifacts\", \"bin\", \"aspire-managed\")\n    : null;\nif (managedPath is not null && !File.Exists(managedPath))\n{\n    Console.Error.WriteLine($\"Dashboard binary missing at {managedPath}; run 'aspire setup --force'.\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await captureService.StartAsync(options, ct);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"aspire-managed\"))\n{\n    Console.Error.WriteLine(\"Bundle incomplete — running 'aspire setup --force'...\");\n}","preventionTips":["Never manually delete or edit the CLI bundle cache directory.","Remove stale ASPIRE_REPO_ROOT / managed-path overrides when not doing repo-local development.","Run 'aspire setup --force' after upgrading the CLI if layout errors appear."],"tags":["file-not-found","cli","dashboard","bundle","profiling"],"backgroundTag":"file-not-found","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}