{"record":{"id":"02f88c883088f8fc","repo":"microsoft/aspire","slug":"value-cannot-be-null-parameter-value-pipelinesummaryitem","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'value')","messagePattern":"Value cannot be null\\. \\(Parameter 'value'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting/Pipelines/PipelineSummaryItem.cs","lineNumber":26,"sourceCode":"/// <summary>\n/// Represents a single item in a <see cref=\"PipelineSummary\"/>, consisting of a key, a value,\n/// and a flag indicating whether the value contains Markdown formatting.\n/// </summary>\n/// <param name=\"key\">The key or label for the summary item.</param>\n/// <param name=\"value\">The string value for the summary item.</param>\n/// <param name=\"enableMarkdown\">Whether the <paramref name=\"value\"/> contains Markdown formatting.</param>\n[Experimental(\"ASPIREPIPELINES001\", UrlFormat = \"https://aka.ms/aspire/diagnostics/{0}\")]\npublic sealed class PipelineSummaryItem(string key, string value, bool enableMarkdown)\n{\n    /// <summary>\n    /// Gets the key or label for the summary item (e.g., \"Namespace\", \"URL\").\n    /// </summary>\n    public string Key { get; } = key ?? throw new ArgumentNullException(nameof(key));\n\n    /// <summary>\n    /// Gets the string value for the summary item.\n    /// </summary>\n    public string Value { get; } = value ?? throw new ArgumentNullException(nameof(value));\n\n    /// <summary>\n    /// Gets a value indicating whether <see cref=\"Value\"/> contains Markdown formatting that\n    /// should be rendered by the CLI output.\n    /// </summary>\n    public bool EnableMarkdown { get; } = enableMarkdown;\n}\n","sourceCodeStart":8,"sourceCodeEnd":34,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting/Pipelines/PipelineSummaryItem.cs#L8-L34","documentation":"PipelineSummaryItem's constructor throws ArgumentNullException with parameter name 'value' when the summary item value string is null. Value is a get-only property assigned with an inline null guard, so construction with a null value fails at the call site. An empty string is allowed; only null is rejected.","triggerScenarios":"Calling new PipelineSummaryItem(key, null) or new PipelineSummaryItem(key, null, enableMarkdown) — e.g. a computed endpoint URL, status, or output that ended up null.","commonSituations":"A pipeline step summarizes a resource whose property (URL, connection string, deployment output) was not yet available and the null value flows into the constructor.","solutions":["Pass a non-null value string, using string.Empty if intentionally blank.","Coalesce nulls before construction: value ?? \"<not available>\".","Ensure the data the value is derived from is resolved before creating the summary item."],"exampleFix":"// before\nvar item = new PipelineSummaryItem(\"URL\", endpointUrl);\n\n// after\nvar item = new PipelineSummaryItem(\"URL\", endpointUrl ?? \"<not available>\");","handlingStrategy":"validation","validationCode":"if (value is null)\n{\n    value = \"<not available>\";\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    var item = new PipelineSummaryItem(key, value);\n}\ncatch (ArgumentNullException ex) when (ex.ParamName == \"value\")\n{\n    logger.LogWarning(\"Summary value for '{Key}' was null; skipping item.\", key);\n}","preventionTips":["Coalesce nullable values with ?? \"<not available>\" before constructing.","Resolve endpoints/outputs before summarizing.","Treat empty string as the blank-value convention instead of null."],"tags":["argument-null","pipelines","reporting"],"backgroundTag":"null-argument","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}