microsoft/aspire · error · InvalidOperationException

Prompt provided without input data.

Error message

Prompt provided without input data.

What it means

When the AppHost requests a user prompt during publishing, the CLI renders an interactive prompt from the activity's Data.Inputs collection. If an activity arrives marked as a prompt but carries no input definitions, the CLI cannot construct any prompt UI and throws this InvalidOperationException.

Solutions

  1. Fix the AppHost/publisher code so every prompt activity supplies at least one input (e.g. a text or select PublishingPromptInput)
  2. Align Aspire.Hosting versions between CLI and AppHost and rebuild
  3. Re-run with a scenario that actually requests input

Example fix

// before
InteractionService.PromptAsync("Choose env", inputs: null);
// after
InteractionService.PromptAsync("Choose env", inputs: new[] { new PublishingPromptInput { Name = "env", InputType = InputType.Text, Required = true } });
Defensive patterns

Strategy: validation

Validate before calling

if (activity.Data.Inputs is not { Count: > 0 })
{
    // AppHost sent a prompt with no inputs; cannot render
    return;
}

Try / catch

try { ShowPrompt(activity); }
catch (InvalidOperationException ex) when (ex.Message == "Prompt provided without input data.") { Console.Error.WriteLine("AppHost sent an empty prompt."); }

Prevention

When it happens

Trigger: A custom IPublisherActivity/prompt activity posted with an interaction request but Data.Inputs empty or null during `aspire publish`; an AppHost bug where CompleteInteraction/prompt APIs are called without supplying PublishingPromptInput entries.

Common situations: Custom publisher or pipeline code that calls the prompt API with no inputs; an AppHost built against an older interaction wire format whose inputs field serializes to empty under a newer CLI.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src/Aspire.Cli/Commands/PipelineCommandBase.cs:1075

        // Show StatusText as header (converted from markdown), then Label on new line
        var convertedHeader = ConvertTextWithMarkdownFlag(header, activityData);
        var convertedLabel = ConvertTextWithMarkdownFlag(label, activityData);
        return $"[bold]{convertedHeader}[/]\n{convertedLabel}: ";
    }

    private async Task HandlePromptActivityAsync(PublishingActivity activity, IAppHostCliBackchannel backchannel, CancellationToken cancellationToken)
    {
        if (activity.Data.IsComplete)
        {
            // Prompt is already completed, nothing to do
            return;
        }

        // Check if we have input information
        if (activity.Data.Inputs is not { Count: > 0 } inputs)
        {
            throw new InvalidOperationException("Prompt provided without input data.");
        }

        // Check for validation errors. If there are errors then this isn't the first time the user has been prompted.
        var hasValidationErrors = inputs.Any(input => input.ValidationErrors is { Count: > 0 });

        // For multiple inputs, display the activity status text as a header.
        // Don't display if there are validation errors. Validation errors means the header has already been displayed.
        if (!hasValidationErrors && inputs.Count > 1)
        {
            var headerText = ConvertTextWithMarkdownFlag(activity.Data.StatusText, activity.Data);
            AnsiConsole.MarkupLine($"[bold]{headerText}[/]");
        }

        // Handle multiple inputs
        var answers = new PublishingPromptInputAnswer[inputs.Count];
        for (var i = 0; i < inputs.Count; i++)
        {
            var input = inputs[i];

View on GitHub (pinned to 25830f84bd)