{"record":{"id":"36a9880077b4e0d6","repo":"microsoft/aspire","slug":"could-not-find-dcp-executable-in-the-aspire-layout","errorCode":null,"errorMessage":"Could not find DCP executable in the Aspire layout.","messagePattern":"Could not find DCP executable in the Aspire layout\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/DotNet/ProcessExecution.cs","lineNumber":171,"sourceCode":"        if (!_options.Detached || OperatingSystem.IsWindows() || _startInfo.DetachedUnixLauncherPath is not null)\n        {\n            return null;\n        }\n\n        if (_layoutDiscovery is null || _bundleService is null || _executionContext is null)\n        {\n            throw new InvalidOperationException(\"Detached Unix process launch requires Aspire layout services.\");\n        }\n\n        var dcpExecutable = await DcpExecutableResolver.TryGetDcpExecutableAsync(\n            _layoutDiscovery,\n            _bundleService,\n            _executionContext,\n            \"dcp-fork-process\",\n            cancellationToken).ConfigureAwait(false);\n        if (dcpExecutable is null)\n        {\n            throw new InvalidOperationException(\"Could not find DCP executable in the Aspire layout.\");\n        }\n\n        try\n        {\n            if (dcpExecutable.LayoutLease is not null)\n            {\n                var environment = _startInfo.Environment\n                    .Where(static kvp => kvp.Value is not null)\n                    .ToDictionary(static kvp => kvp.Key, static kvp => kvp.Value!, ProcessEnvironment.Comparer);\n                dcpExecutable.LayoutLease.AddEnvironment(environment);\n\n                foreach (var (key, value) in environment)\n                {\n                    _startInfo.Environment[key] = value;\n                }\n            }\n\n            _startInfo.DetachedUnixLauncherPath = dcpExecutable.ExecutablePath;","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/DotNet/ProcessExecution.cs#L153-L189","documentation":"After confirming layout services exist, ResolveDetachedUnixLauncherAsync asks DcpExecutableResolver to locate the 'dcp-fork-process' executable shipped with the Aspire layout. When it cannot be found, the CLI refuses to proceed with a detached Unix launch and throws this InvalidOperationException, because forking a detached child without the DCP helper is unsupported.","triggerScenarios":"StartAsync with detached Unix launch where TryGetDcpExecutableAsync returns null: the DCP bundle is missing or not yet downloaded, the Aspire layout is incomplete/corrupted, or the CLI was run from a non-standard installation without the DCP artifact.","commonSituations":"Partial or interrupted CLI installation; running the CLI from a source build without the DCP bundle; a version mismatch where the installed layout predates dcp-fork-process; cleaning the bundle cache and launching before re-acquisition.","solutions":["Reinstall or repair the Aspire CLI so the complete layout including the DCP bundle is present.","Let the bundle service re-download the DCP bundle, then retry the launch.","Verify the resolved layout directory actually contains the 'dcp-fork-process' executable.","Use attached (non-detached) execution as a fallback when no layout is available."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"var dcp = await DcpExecutableResolver.TryGetDcpExecutableAsync(layout, bundles, ctx, \"dcp-fork-process\", ct);\nif (dcp is null) { /* repair layout or fall back */ }","typeGuard":null,"tryCatchPattern":"try { await executor.StartAsync(spec, detached: true); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"DCP executable\"))\n{\n    logger.LogWarning(\"DCP missing from layout; reinstalling or falling back.\");\n    await executor.StartAsync(spec, detached: false);\n}","preventionTips":["Repair/reinstall the Aspire CLI if the layout seems incomplete.","Check that the layout directory contains dcp-fork-process before launching detached.","Keep the bundle cache intact; re-download after cleaning.","Use attached execution when no layout is available."],"tags":["cli","dcp","process-launch","unix","layout"],"backgroundTag":"resource-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"}