Skip to content

Support local tool manifests for AppHost DNX invocation - #19310

Merged
Damian Edwards (DamianEdwards) merged 1 commit into
mainfrom
damianedwards-support-dnx-pinned
Aug 12, 2026
Merged

Support local tool manifests for AppHost DNX invocation#19310
Damian Edwards (DamianEdwards) merged 1 commit into
mainfrom
damianedwards-support-dnx-pinned

Conversation

@DamianEdwards

Copy link
Copy Markdown
Member

Description

C# AppHosts can now opt into DNX resolution that honors an in-scope .NET local tools manifest. This allows a repository to pin Aspire.Cli in .config/dotnet-tools.json and use that version when launching an AppHost through dotnet run.

The supported AspireCliInvocationMode values now behave as follows:

  • Path continues to resolve a compatible aspire command from PATH, falling back to the Aspire.Cli version paired with AspireHostingSDKVersion through DNX.
  • Dnx invokes the unversioned aspire.cli package through DNX, which honors an in-scope tool manifest or resolves the latest package when no manifest applies.
  • DnxPinned forces DNX invocation using aspire.cli@$(AspireHostingSDKVersion).

User-facing usage

To use the Aspire.Cli version from an in-scope local tools manifest:

<PropertyGroup>
  <AspireUseCliBundle>true</AspireUseCliBundle>
  <AspireCliInvocationMode>Dnx</AspireCliInvocationMode>
</PropertyGroup>

Use DnxPinned instead when the CLI must match the AppHost SDK version exactly.

Fixes #19309

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 5ef93c6b-3a80-4def-bd41-ca462a3d26b0
Copilot AI balanced review requested due to automatic review settings August 12, 2026 21:22
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19310

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19310"

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

43 / 100 test projects · 2 jobs, from 3 changed files.

Selected test projects (43 / 100)

Aspire.EndToEnd.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.GitHub.Models.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.Sdk.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests

Selected jobs (2)

extension-e2e, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 41 of the 43 selected test projects come from a single change — src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets.

🔧 src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets (changed source)
41 via the project graph

show 41

Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.GitHub.Models.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests

📦 affected project Aspire.Hosting.AppHost
1 test: Aspire.EndToEnd.Tests

🧪 tests/Aspire.Hosting.Sdk.Tests/AppHostSdkTargetsTests.cs (changed test)
1 directly: Aspire.Hosting.Sdk.Tests

Job reasons

Job Triggered by
extension-e2e src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets, src/Aspire.Hosting.Tasks/ResolveAspireCliInvocation.cs
• affected project Aspire.Hosting.AppHost
typescript-api-compat affected project Aspire.Hosting.AppHost

Selection computed for commit f61ce46.

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

Adds manifest-aware DNX resolution for AppHost CLI launches while preserving pinned behavior.

Changes:

  • Makes Dnx manifest-aware.
  • Adds DnxPinned for SDK-matched CLI resolution.
  • Updates tests and diagnostics documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
ResolveAspireCliInvocation.cs Recognizes DnxPinned.
Aspire.Hosting.AppHost.in.targets Selects pinned or unversioned DNX packages.
AppHostSdkTargetsTests.cs Tests both DNX modes.
list-of-diagnostics.md Documents updated behavior.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.in.targets
@DamianEdwards
Damian Edwards (DamianEdwards) marked this pull request as ready for review August 12, 2026 21:54
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@DamianEdwards
Damian Edwards (DamianEdwards) merged commit dae6eaf into main Aug 12, 2026
722 of 725 checks passed
@DamianEdwards
Damian Edwards (DamianEdwards) deleted the damianedwards-support-dnx-pinned branch August 12, 2026 22:57
@DamianEdwards

Copy link
Copy Markdown
Member Author

/backport to release/13.5

@github-actions github-actions Bot added this to the 13.6 milestone Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/13.5 (link to workflow run)

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1484

Generated by PR Documentation Check · auto · 91.3 AIC · ⌖ 11 AIC · ⊞ 19.6K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1484 targeting release/13.5.

Added a new "Running with dotnet run" subsection to get-started/aspire-sdk.mdx documenting the AspireCliInvocationMode MSBuild property and its Path / Dnx / DnxPinned values, including how Dnx mode honors an in-scope .NET local tool manifest and the ASPIRE011 error/remediation. Signals triggered: diagnostic_documentation_changed (ASPIRE011 message text updated in docs/list-of-diagnostics.md), pr_body_has_user_facing_section (PR body's "User-facing usage" section with the XML snippet setting AspireCliInvocationMode).

Note

This draft PR needs human review before merging.

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

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C# AppHosts should support honoring .NET local tools manifests when using the aspire CLI bundle via dnx invocation

3 participants