{"record":{"id":"1f8ba1ea8c79d74a","repo":"microsoft/aspire","slug":"the-output-path-path-option-was-not-specified-even-though-1f8ba1","errorCode":null,"errorMessage":"The '--output-path [path]' option was not specified even though manifest publishing was requested.","messagePattern":"The '--output-path \\[path\\]' option was not specified even though manifest publishing was requested\\.","errorType":"exception","errorClass":"DistributedApplicationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting/Publishing/ManifestPublishingExtensions.cs","lineNumber":40,"sourceCode":"    /// <param name=\"pipeline\">The pipeline to add the manifest publishing step to.</param>\n    /// <returns>The pipeline for chaining.</returns>\n    [AspireExportIgnore(Reason = \"Manifest publishing is an internal pipeline step and not part of the polyglot AppHost surface.\")]\n    public static IDistributedApplicationPipeline AddManifestPublishing(this IDistributedApplicationPipeline pipeline)\n    {\n        var step = new PipelineStep\n        {\n            Name = \"publish-manifest\",\n            Description = \"Publishes the Aspire application model as a JSON manifest file.\",\n            Action = async context =>\n            {\n                var loggerFactory = context.Services.GetRequiredService<ILoggerFactory>();\n                var logger = loggerFactory.CreateLogger(\"Aspire.Hosting.Publishing.ManifestPublisher\");\n                var pipelineOptions = context.Services.GetRequiredService<IOptions<PipelineOptions>>();\n                var executionContext = context.Services.GetRequiredService<DistributedApplicationExecutionContext>();\n\n                if (pipelineOptions.Value.OutputPath == null)\n                {\n                    throw new DistributedApplicationException(\n                        \"The '--output-path [path]' option was not specified even though manifest publishing was requested.\"\n                        );\n                }\n\n                var outputPath = pipelineOptions.Value.OutputPath;\n\n                if (!outputPath.EndsWith(\".json\", StringComparison.Ordinal))\n                {\n                    // If the manifest path ends with .json we assume that the output path was specified\n                    // as a filename. If not, we assume that the output path was specified as a directory\n                    // and append aspire-manifest.json to the path. This is so that we retain backwards\n                    // compatibility with AZD, but also support manifest publishing via the Aspire CLI\n                    // where the output path is a directory (since not all publishers use a manifest).\n                    outputPath = Path.Combine(outputPath, \"aspire-manifest.json\");\n                }\n\n                var parentDirectory = Directory.GetParent(outputPath);\n                if (!Directory.Exists(parentDirectory!.FullName))","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting/Publishing/ManifestPublishingExtensions.cs#L22-L58","documentation":"Manifest publishing is requested via --publisher manifest, but the mandatory --output-path option is missing, so the publisher has nowhere to write the manifest. The check in AddManifestPublishing's callback fails fast at app start rather than producing an empty or misplaced manifest.","triggerScenarios":"Running the AppHost with `dotnet run --publisher manifest` (or --publish-type manifest via aspire publish path) without `--output-path <file>`; CI scripts invoking manifest publishing that omit the flag.","commonSituations":"Command-line typos or dropped arguments when generating a deployment manifest; older scripts written before the output-path requirement; hand-typed publish commands.","solutions":["Add --output-path to the command: `dotnet run --publisher manifest --output-path ./aspire-manifest.json`.","Update CI/deploy scripts to include --output-path when manifest publishing is requested.","If you did not intend to publish a manifest, remove the --publisher/--publish flags."],"exampleFix":"// before\ndotnet run --publisher manifest\n// after\ndotnet run --publisher manifest --output-path ./aspire-manifest.json","handlingStrategy":"validation","validationCode":"if (args.Contains(\"--publisher\") && !args.Contains(\"--output-path\"))\n{\n    throw new ArgumentException(\"--output-path is required when --publisher is specified.\");\n}","typeGuard":null,"tryCatchPattern":"catch (DistributedApplicationException ex) when (ex.Message.Contains(\"--output-path\"))\n{\n    // print usage guidance\n}","preventionTips":["Always include --output-path with manifest publishing commands.","Script publish commands once and reuse them instead of typing ad hoc.","Add a smoke CI job that runs manifest publishing."],"tags":["cli","manifest","publishing"],"backgroundTag":"missing-required-flag","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-22T11:17:16.035Z"}