Skip to content

Fix incorrect parameter name in WithProcessCommand doc examples (name → commandName)#1154

Merged
IEvangelist merged 2 commits into
mainfrom
copilot/docs-fix-basic-command-examples
Jun 8, 2026
Merged

Fix incorrect parameter name in WithProcessCommand doc examples (name → commandName)#1154
IEvangelist merged 2 commits into
mainfrom
copilot/docs-fix-basic-command-examples

Conversation

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Doc examples for WithProcessCommand used name: as the C# named argument, but the actual API parameter is commandName:. Copy-pasting any example produced CS1739: The best overload for 'WithProcessCommand' does not have a parameter named 'name'.

Changes

  • whats-new/aspire-13-4.mdx — fix name:commandName: in the introductory example
  • fundamentals/custom-resource-commands.mdx — fix both the basic and dynamic WithProcessCommand examples
  • diagnostics/aspireprocesscommand001.mdx — fix the diagnostic reference example
// Before (broken)
builder.AddRedis("cache")
    .WithProcessCommand(
        name: "dotnet-version",         // ❌ CS1739
        displayName: "Show .NET version",
        executablePath: "dotnet",
        arguments: ["--version"]);

// After (correct)
builder.AddRedis("cache")
    .WithProcessCommand(
        commandName: "dotnet-version",  // ✅
        displayName: "Show .NET version",
        executablePath: "dotnet",
        arguments: ["--version"]);

… docs

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect basic command examples in WithProcessCommand API Fix incorrect parameter name in WithProcessCommand doc examples (name → commandName) Jun 2, 2026
Copilot AI requested a review from IEvangelist June 2, 2026 02:40

@alistairmatthews alistairmatthews left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are correct and the code now patches the WithProcessCommand definition; https://github.com/microsoft/aspire/blob/6518fb56fe0cf63a23fc86767c6181352903e68c/src/Aspire.Hosting/ResourceBuilderExtensions.cs

@IEvangelist IEvangelist marked this pull request as ready for review June 8, 2026 03:46
Copilot AI review requested due to automatic review settings June 8, 2026 03:46
@IEvangelist IEvangelist merged commit 9c47f12 into main Jun 8, 2026
9 checks passed
@IEvangelist IEvangelist deleted the copilot/docs-fix-basic-command-examples branch June 8, 2026 03:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes C# documentation examples for the experimental WithProcessCommand API to use the correct named argument (commandName:) instead of the non-existent name: parameter, preventing CS1739 when readers copy/paste the samples.

Changes:

  • Update the Aspire 13.4 “What’s new” example to use commandName:.
  • Update both “static” and “dynamic” WithProcessCommand examples in the custom resource commands fundamentals doc.
  • Update the ASPIREPROCESSCOMMAND001 diagnostic page example to use commandName:.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/frontend/src/content/docs/whats-new/aspire-13-4.mdx Fixes the introductory WithProcessCommand sample to use the correct named parameter.
src/frontend/src/content/docs/fundamentals/custom-resource-commands.mdx Fixes both static and dynamic WithProcessCommand samples to use commandName:.
src/frontend/src/content/docs/diagnostics/aspireprocesscommand001.mdx Fixes the diagnostic reference example to use commandName:.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] Incorrect basic command examples in WithProcessCommand API

4 participants