{"record":{"id":"fe4e8be7969b36c1","repo":"microsoft/aspire","slug":"unix-detached-process-launch-requires-a-dcp-executable-path","errorCode":null,"errorMessage":"Unix detached process launch requires a DCP executable path.","messagePattern":"Unix detached process launch requires a DCP executable path\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Processes/IsolatedProcess.Unix.cs","lineNumber":17,"sourceCode":"// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace Aspire.Cli.Processes;\n\ninternal sealed partial class IsolatedProcess\n{\n    private static async Task<StartedProcess> StartDetachedUnixAsync(\n        IsolatedProcessStartInfo startInfo,\n        CancellationToken cancellationToken)\n    {\n        if (startInfo.DetachedUnixLauncherPath is null)\n        {\n            throw new InvalidOperationException(\"Unix detached process launch requires a DCP executable path.\");\n        }\n\n        var dcpStartInfo = new ProcessStartInfo\n        {\n            FileName = startInfo.DetachedUnixLauncherPath,\n            UseShellExecute = false,\n            CreateNoWindow = true,\n            RedirectStandardOutput = true,\n            RedirectStandardError = true,\n            RedirectStandardInput = false,\n            WorkingDirectory = startInfo.WorkingDirectory\n        };\n\n        dcpStartInfo.ArgumentList.Add(\"fork-process\");\n        dcpStartInfo.ArgumentList.Add(\"--monitor\");\n        dcpStartInfo.ArgumentList.Add(Environment.ProcessId.ToString(CultureInfo.InvariantCulture));\n        dcpStartInfo.ArgumentList.Add(\"--monitor-identity-time\");\n        dcpStartInfo.ArgumentList.Add(ProcessTreeGracefulShutdownService.FormatDcpProcessStartTime(GetCurrentProcessDcpMonitorStartTime()));","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Processes/IsolatedProcess.Unix.cs#L1-L35","documentation":"On Unix, IsolatedProcess's detached start mode forks the process through the DCP (Developer Control Plane) executable, which must be supplied via DetachedUnixLauncherPath on the start info. StartDetachedUnixAsync throws InvalidOperationException when that path is null because a detached launch cannot proceed without the launcher.","triggerScenarios":"Calling IsolatedProcess.StartAsync with Detached = true (or equivalent detached start info) on Unix while startInfo.DetachedUnixLauncherPath was never set, typically because the DCP path wasn't resolved from the CLI's DCP locator.","commonSituations":"A dev environment where DCP was not built/downloaded; the CLI's DCP resolution failed silently and returned null; manually constructing IsolatedProcessStartInfo without setting the launcher path.","solutions":["Ensure the DCP executable exists and is resolved (check the Aspire CLI installation / DOTNET ASPIRE defaults) before starting detached.","Set DetachedUnixLauncherPath explicitly on IsolatedProcessStartInfo when constructing it manually.","Reinstall or update the Aspire CLI so the DCP binaries are present.","Run in non-detached mode if DCP is unavailable, so the process is launched directly."],"exampleFix":"// before\nvar startInfo = new IsolatedProcessStartInfo { Detached = true }; // no launcher path\n// after\nvar startInfo = new IsolatedProcessStartInfo\n{\n    Detached = true,\n    DetachedUnixLauncherPath = dcpPath // resolved from DcpLocator\n};","handlingStrategy":"type-guard","validationCode":"if (startInfo.Detached && startInfo.DetachedUnixLauncherPath is null)\n    throw new InvalidOperationException(\"Detached start on Unix requires DetachedUnixLauncherPath.\");","typeGuard":"bool CanStartDetached(IsolatedProcessStartInfo info) =>\n    !info.Detached || info.DetachedUnixLauncherPath is not null;","tryCatchPattern":"try\n{\n    await process.StartAsync(ct);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"DCP executable path\"))\n{\n    // resolve DCP path and retry, or fall back to non-detached start\n}","preventionTips":["Always resolve DCP via the locator before detached starts","Assert DCP presence during environment setup","Fall back to non-detached mode when DCP is unavailable"],"tags":["process","dcp","unix","missing-argument"],"backgroundTag":"missing-required-config-field","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"}