microsoft/aspire · critical · DistributedApplicationException

Application orchestrator dependency check returned an…

Error message

Application orchestrator dependency check returned an error: 'dcp {arguments}' returned exit code {exitCode}. {stderr}{newline}{stdout}

What it means

GetDcpInfoAsync runs the dcp binary (e.g. 'dcp info') and if it exits non-zero the error output is wrapped in a DistributedApplicationException using the DcpDependencyCheckFailedMessage template. It means the DCP process itself ran but reported failure.

Solutions

  1. Read the captured stderr/stdout in the exception message to see dcp's own error and address it.
  2. Delete stale DCP state/cache directories and let Aspire regenerate them.
  3. Reinstall or update the Aspire CLI/hosting packages so the dcp binary version matches the SDK.
  4. Ensure required OS prerequisites (correct OS/arch build of dcp) are installed.
Defensive patterns

Strategy: try-catch

Validate before calling

var probe = await ProcessX.StartAsync("dcp info"); // or run 'dcp --version' yourself; check exit code and stderr before starting the AppHost

Try / catch

try
{
    var info = await dcpDependencyCheck.GetDcpInfoAsync(ct);
}
catch (DistributedApplicationException ex)
{
    logger.LogError(ex, "dcp dependency check failed: {Details}", ex.Message); // message embeds dcp stderr/stdout
}

Prevention

When it happens

Trigger: 'dcp <arguments>' (dependency/version info command) completes with ExitCode != 0 while collecting dcp info in GetDcpInfoAsync.

Common situations: Corrupted or incompatible dcp binary, missing runtime prerequisites on the machine, malformed dcp home/state directories, or a dcp version whose CLI arguments changed.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/38e4d261fc843cf0. Report an issue: GitHub.

Appendix: source

Thrown at src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:88

                    ThrowOnNonZeroReturnCode = false
                };

                (task, processDisposable) = ProcessUtil.Run(processSpec);
                ProcessResult processResult;

                // Disable timeout if DependencyCheckTimeout is set to zero or a negative value
                if (_dcpOptions.DependencyCheckTimeout > 0)
                {
                    processResult = await task.WaitAsync(TimeSpan.FromSeconds(_dcpOptions.DependencyCheckTimeout), cancellationToken).ConfigureAwait(false);
                }
                else
                {
                    processResult = await task.WaitAsync(cancellationToken).ConfigureAwait(false);
                }

                if (processResult.ExitCode != 0)
                {
                    throw new DistributedApplicationException(string.Format(
                        CultureInfo.InvariantCulture,
                        MessageStrings.DcpDependencyCheckFailedMessage,
                        $"'dcp {arguments}' returned exit code {processResult.ExitCode}. {errorStringBuilder.ToString()}{Environment.NewLine}{outputStringBuilder.ToString()}"
                    ));
                }

                // Parse the output as JSON
                var output = outputStringBuilder.ToString();
                if (output == string.Empty)
                {
                    return null; // Best effort
                }

                var dcpInfo = JsonSerializer.Deserialize<DcpInfo>(output);
                if (dcpInfo == null)
                {
                    return null; // Best effort
                }

View on GitHub (pinned to 25830f84bd)