Skip to content

Recognize WSLc in Aspire doctor and clarify runtime selection - #21004

Merged
David Negstad (danegsta) merged 10 commits into
mainfrom
danegsta-wslc-runtime-support
Oct 15, 2026
Merged

David Negstad (danegsta) merged 10 commits into
mainfrom
danegsta-wslc-runtime-support

Conversation

@danegsta

Copy link
Copy Markdown
Member

Description

aspire doctor currently checks Docker and Podman even when WSLc is configured and supported by DCP for local development on Windows. This can report unrelated runtime problems instead of checking the runtime the user selected.

This change recognizes Windows-only WSLc support and checks only the configured runtime when either runtime environment variable is set. Auto-detection reports all installed runtimes in Docker, Podman, WSLc priority order, marks the selected runtime, and makes incompatible alternatives non-blocking when a healthy runtime is available. Missing runtimes are omitted unless explicitly selected.

Runtime probes share Aspire's existing availability check and process handling, with WSLc overriding host support and version metadata parsing. Caller cancellation is preserved. Publishing remains restricted to Docker and Podman; WSLc publish/deploy support is a follow-up, not part of this PR.

Examples

aspire doctor
$env:ASPIRE_CONTAINER_RUNTIME = 'wslc'
aspire doctor

Example runtime output with multiple installed runtimes:

Docker v29.8.2: running ← active
Podman: installed but not running
WSLc v3.0.3.0: running

With WSLc explicitly configured:

WSLc v3.0.3.0: running ← explicitly selected

Validation

  • Passed: dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.ContainerRuntimeCheckTests' --filter-class '*.DoctorCommandTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' (75 tests).
  • Passed: dotnet test --project tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-class '*.ContainerRuntimeDetectorTests' --filter-class '*.ContainerRuntimeResolverTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' (18 tests).
  • Passed: dotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-restore --verbosity quiet /p:SkipNativeBuild=true (zero warnings/errors). The six new selection-indicator E2E cases verify text and JSON output for automatic selection, Podman fallback, and explicit Docker/Podman selection through both environment-variable names. E2E execution was not run locally; CI validation is pending.
  • Manually checked the locally built CLI with installed Docker, Podman, and WSLc, including automatic selection and explicit WSLc configuration. Both doctor runs exited 0. Also verified caller cancellation during an in-flight metadata query terminates the controlled probe process.

Fixes: #20900

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: f85e4b06-371e-465a-8fd8-e635d14ec41f
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
@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 -- 21004

Or

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

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 14, 2026 17:23
@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

Runtime diagnostics can mask an incompatible active runtime, mishandle empty configuration, and time out on undrained process output.

6 open findings
What changed in this PR

Adds Windows-only WSLc recognition to aspire doctor and clarifies runtime selection, addressing #20900 while keeping publishing limited to Docker and Podman.

Changes:

  • Checks explicitly configured runtimes and labels runtime selection.
  • Extracts shared probes and adds WSLc metadata handling.
  • Updates tests and runtime prerequisites documentation.
File Description
tests/​Aspire.Hosting.TestUtilities/​Utils/​DockerUtils.cs Clarifies cleanup behavior in comments.
tests/​Aspire.Hosting.Tests/​Publishing/​ContainerRuntimeDetectorTests.cs Updates priority, parsing, and cancellation tests.
tests/​Aspire.Cli.Tests/​Utils/​ContainerRuntimeCheckTests.cs Adds runtime configuration and WSLc checks.
tests/​Aspire.Cli.EndToEnd.Tests/​DoctorCommandTests.cs Tests selection indicators in text and JSON.
src/​Shared/​WslcContainerRuntimeProbe.cs Adds Windows support checks and WSLc parsing.
src/​Shared/​KnownContainerRuntimes.cs Defines the WSLc runtime name.
src/​Shared/​ContainerRuntimeProbe.cs Extracts shared probing and metadata handling.
src/​Shared/​ContainerRuntimeDetector.cs Adds prioritized, host-aware runtime discovery.
src/​Aspire.Hosting/​Publishing/​ContainerRuntimeResolver.cs Restricts publishing discovery to Docker and Podman.
src/​Aspire.Hosting/​Aspire.Hosting.csproj Includes shared probe files.
src/​Aspire.Cli/​Utils/​EnvironmentChecker/​ContainerRuntimeCheck.cs Updates runtime selection and diagnostics.
src/​Aspire.Cli/​Aspire.Cli.csproj Includes shared probe files.
docs/​machine-requirements.md Documents WSLc support and limitations.

🧠 Review effort: Balanced

Comment thread src/Shared/ContainerRuntimeProbe.cs Resolved
Comment thread src/Shared/ContainerRuntimeProbe.cs Resolved
Comment thread src/Shared/ContainerRuntimeProbe.cs Resolved
@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.

@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.

@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.

Stream runtime metadata and drain process output concurrently while retaining failure diagnostics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

A metadata parsing failure combined with cancellation can bypass process termination and leave the probe running.

1 open finding
6 resolved since last review

🧠 Review effort: Balanced

Comment thread src/Shared/ContainerRuntimeProbe.cs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

Cross-platform process-lifecycle changes warrant human validation, and execution of the new end-to-end scenarios remains pending.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@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.

@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.

@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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

Cross-platform process lifecycle changes and pending end-to-end execution warrant final human validation.

0 open findings

🧠 Review effort: Balanced

@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

Shared process-lifecycle changes, an unresolved WSLc health-check mismatch, and pending end-to-end validation require human review.

1 open finding
Files not reviewed (1)
  • src/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
Previously missed (1)

In code that hasn't changed since last review

Medium severity Validate WSLc versions and network before marking it running

src/​Shared/​ContainerRuntimeProbe.cs:193

A successful container ls marks WSLc as running even when DCP would reject it. DCP's WslcCliOrchestrator.getStatus requires supported client/session-manager versions and a successful network-list probe before setting Running. Here, WSLc 3.0.1 receives only a doctor warning, and a network-list failure is never checked. When Docker and Podman are unavailable, doctor can therefore mark an unusable WSLc runtime active. Add WSLc-specific availability validation before setting IsRunning, preserving the failure details for reporting.

🧠 Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
@github-actions

This comment has been minimized.

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.

🔵 Needs a closer look

Shared subprocess changes and pending end-to-end execution require human validation, alongside the unresolved WSLc version-format issue.

0 open findings

1 resolved since last review
Files not reviewed (1)
  • src/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file
Previously missed (1)

In code that hasn't changed since last review

Medium severity Reject two-component WSLc runtime versions during validation

src/​Shared/​WslcContainerRuntimeProbe.cs:64

ParseRuntimeVersion accepts two-component versions through Version.TryParse. If WSLc reports 3.1 for either component, it passes the minimum-version check and doctor can report the runtime as usable. DCP's validateWslcVersion rejects that format: it accepts four-component native versions or semantic versions. Reject versions missing a build component here, without removing Docker's two-component support from the shared parser. Add regression cases for both the client and session-manager fields.

🧠 Review effort: Balanced

@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.

@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.

Comment thread docs/machine-requirements.md Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

99 / 99 PR test projects · 7 PR jobs, from 30 changed files.

Selected PR test projects (99 / 99)

Aspire.Acquisition.Tests, Aspire.Azure.AI.Extensions.OpenAI.Tests, Aspire.Azure.AI.Projects.Tests, Aspire.Azure.Data.Tables.Tests, Aspire.Azure.Messaging.EventHubs.Tests, Aspire.Azure.Messaging.ServiceBus.Tests, Aspire.Azure.Messaging.WebPubSub.Tests, Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL.Tests, Aspire.Azure.Npgsql.Tests, Aspire.Azure.Search.Documents.Tests, Aspire.Azure.Security.KeyVault.Tests, Aspire.Azure.Storage.Blobs.Tests, Aspire.Azure.Storage.Files.DataLake.Tests, Aspire.Azure.Storage.Queues.Tests, Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Confluent.Kafka.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.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.Go.Tests, Aspire.Hosting.Java.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.RemoteHost.Tests, Aspire.Hosting.Rust.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.Keycloak.Authentication.Tests, Aspire.Managed.Tests, Aspire.Microsoft.Azure.Cosmos.Tests, Aspire.Microsoft.Azure.StackExchangeRedis.Tests, Aspire.Microsoft.Data.SqlClient.Tests, Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests, Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests, Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests, Aspire.Milvus.Client.Tests, Aspire.MongoDB.Driver.Tests, Aspire.MongoDB.EntityFrameworkCore.Tests, Aspire.MySqlConnector.Tests, Aspire.NATS.Net.Tests, Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests, Aspire.Npgsql.Tests, Aspire.OpenAI.Tests, Aspire.Playground.Tests, Aspire.Pomelo.EntityFrameworkCore.MySql.Tests, Aspire.Qdrant.Client.Tests, Aspire.RabbitMQ.Client.Tests, Aspire.Seq.Tests, Aspire.StackExchange.Redis.DistributedCaching.Tests, Aspire.StackExchange.Redis.OutputCaching.Tests, Aspire.StackExchange.Redis.Tests, Aspire.Templates.Tests, Aspire.TerminalHost.Tests, Aspire.Tray.Tests, ConfigurationSchemaGenerator.Tests, Infrastructure.Tests, QuarantineTools.Tests

Selected PR jobs (7)

cli-starter-validation, extension-e2e, homebrew-installer, native-dashboard-validation, polyglot, typescript-api-compat, winget-installer


How these were chosen — grouped by what changed

⚠️ 87 of the 99 selected test projects come from a single change — src/Shared/KnownContainerRuntimes.cs.

🔧 src/Shared/KnownContainerRuntimes.cs (changed source)
→ 87 via the project graph

show 87

Aspire.Acquisition.Tests, Aspire.Azure.AI.Extensions.OpenAI.Tests, Aspire.Azure.AI.Projects.Tests, Aspire.Azure.Data.Tables.Tests, Aspire.Azure.Messaging.EventHubs.Tests, Aspire.Azure.Messaging.ServiceBus.Tests, Aspire.Azure.Messaging.WebPubSub.Tests, Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL.Tests, Aspire.Azure.Npgsql.Tests, Aspire.Azure.Search.Documents.Tests, Aspire.Azure.Security.KeyVault.Tests, Aspire.Azure.Storage.Blobs.Tests, Aspire.Azure.Storage.Files.DataLake.Tests, Aspire.Azure.Storage.Queues.Tests, Aspire.Confluent.Kafka.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Blazor.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.Go.Tests, Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.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.Rust.Tests, Aspire.Hosting.Sdk.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Keycloak.Authentication.Tests, Aspire.Managed.Tests, Aspire.Microsoft.Azure.Cosmos.Tests, Aspire.Microsoft.Azure.StackExchangeRedis.Tests, Aspire.Microsoft.Data.SqlClient.Tests, Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests, Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests, Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests, Aspire.Milvus.Client.Tests, Aspire.MongoDB.Driver.Tests, Aspire.MongoDB.EntityFrameworkCore.Tests, Aspire.MySqlConnector.Tests, Aspire.NATS.Net.Tests, Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests, Aspire.Npgsql.Tests, Aspire.OpenAI.Tests, Aspire.Playground.Tests, Aspire.Pomelo.EntityFrameworkCore.MySql.Tests, Aspire.Qdrant.Client.Tests, Aspire.RabbitMQ.Client.Tests, Aspire.Seq.Tests, Aspire.StackExchange.Redis.DistributedCaching.Tests, Aspire.StackExchange.Redis.OutputCaching.Tests, Aspire.StackExchange.Redis.Tests, Aspire.Templates.Tests, Aspire.TerminalHost.Tests, Aspire.Tray.Tests, ConfigurationSchemaGenerator.Tests, Infrastructure.Tests, QuarantineTools.Tests

🔧 src/Aspire.Hosting/Aspire.Hosting.csproj (changed source)
→ 1 directly: Infrastructure.Tests
→ 7 via the project graph: Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.RemoteHost.Tests

📦 affected project Aspire.Hosting.Dotnet
→ 2 tests: Aspire.Cli.EndToEnd.Tests, Aspire.Templates.Tests

🔧 src/Shared/StringComparers.cs (changed source)
→ 2 via the project graph: Aspire.Hosting.Azure.Tests, Aspire.Hosting.Browsers.Tests

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🔧 src/Aspire.Cli/Aspire.Cli.csproj (changed source)
→ 1 directly: Infrastructure.Tests

🔧 src/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs (changed source)
→ 1 via the project graph: Aspire.Cli.EndToEnd.Tests

🔧 src/Aspire.Cli/Resources/DoctorCommandStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/DoctorCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Utils/ContainerRuntimeCheckTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Hosting.Tests/DockerUtilsTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Publishing/ContainerRuntimeDetectorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Publishing/ContainerRuntimeResolverTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Aspire.Cli.csproj, src/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs, src/Aspire.Cli/Resources/DoctorCommandStrings.resx, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.zh-Hant.xlf, src/Aspire.Cli/Utils/EnvironmentChecker/ContainerRuntimeCheck.cs, src/Aspire.Hosting/Aspire.Hosting.csproj, src/Aspire.Hosting/Publishing/ContainerRuntimeResolver.cs
• affected project Aspire.Cli
homebrew-installer selected test Aspire.Acquisition.Tests
native-dashboard-validation affected project Aspire.Dashboard
polyglot • affected project Aspire.Cli
• affected project Aspire.Hosting.Azure.Provisioning.Sql
typescript-api-compat affected project Aspire.Cli
winget-installer selected test Aspire.Acquisition.Tests

Selection computed for commit 67b3877.

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.

🔵 Needs a closer look

Shared cross-platform subprocess changes warrant human review while execution of the new end-to-end tests remains pending.

0 open findings

Files not reviewed (1)
  • src/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs: Generated file

🧠 Review effort: Balanced

@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.

@danegsta
David Negstad (danegsta) merged commit 229db84 into main Oct 15, 2026
844 of 851 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 15, 2026
aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Oct 15, 2026
Document WSLc as a supported Windows-only container runtime alongside
Docker and Podman, matching microsoft/aspire#21004:
- aspire-doctor.mdx: describe WSLc auto-detection/selection, update
  stale sample output (the old auto-detected/explicit-configuration
  reason text was removed from the CLI), add WSLc examples including
  the minimum-version failure case.
- prerequisites.mdx: add a WSLc callout next to the container runtime
  choices.

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

Copy link
Copy Markdown
Contributor

Pull request created: #1898

Generated by PR Documentation Check · copilot · auto · 144.4 AIC · ⌖ 20.8 AIC · ⊞ 20.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1898 targeting release/17.0.

Documented WSLc support in aspire doctor and the prerequisites guide. Triggered signals: cli_resource_strings_changed (new DoctorCommandStrings.resx entries like ContainerRuntimeInstallWslcFix, ContainerRuntimeUpgradeWslcFixFormat describe new user-facing WSLc messages/fixes) and pr_body_has_cli_flag_mention (PR body documents ASPIRE_CONTAINER_RUNTIME=wslc usage and example doctor output). Updated reference/cli/commands/aspire-doctor.mdx to describe WSLc auto-detection/explicit-selection behavior, refreshed stale sample output (removed obsolete "(auto-detected ...)"/"(explicit configuration)" reason text per the ContainerRuntimeCheck.cs diff), and added WSLc examples including the minimum-version failure case. Added a WSLc callout to get-started/prerequisites.mdx near the container runtime choices.

Note

This draft PR needs human review before merging.

David Negstad (danegsta) pushed a commit to microsoft/aspire.dev that referenced this pull request Oct 16, 2026
Documents changes from microsoft/aspire#21004

``@danegsta``

## Target branch

Targeting `release/17.0` based on the source PR milestone `17.0` (exact
match on `microsoft/aspire.dev`).

## Why

`aspire doctor` now recognizes WSLc (version 3.0.2.0+) as a Windows-only
container runtime alongside Docker and Podman. It auto-detects installed
runtimes in Docker, Podman, WSLc priority order (or checks only the
explicitly configured runtime via `ASPIRE_CONTAINER_RUNTIME=wslc`),
marks the active/selected runtime, and makes incompatible alternatives
non-blocking when a healthy runtime is available. The existing docs only
described Docker/Podman and showed sample `aspire doctor` output using a
reason format (`(auto-detected (default))`, `(explicit configuration)`)
that the PR removed from the CLI, so the docs needed both a WSLc
addition and a correction of stale sample output.

## What changed

- **`reference/cli/commands/aspire-doctor.mdx`**:
- Updated the Container checks bullet to mention WSLc on Windows and the
`← active` / `← explicitly selected` indicators.
- Added a note describing WSLc auto-detection/selection behavior and
platform support (Windows only, not supported inside a Linux WSL
distribution).
- Fixed the existing sample outputs that showed the now-removed
`(auto-detected ...)` / `(explicit configuration)` reason text.
- Added new sample outputs for: multiple runtimes detected on Windows
(Docker/Podman/WSLc priority), explicit `ASPIRE_CONTAINER_RUNTIME=wslc`
selection, and the minimum WSLc version failure case.
- **`get-started/prerequisites.mdx`**: Added a "WSLc on Windows" callout
next to the container runtime choices, noting the minimum version,
auto-detection, explicit selection, and that publish/deploy support is
not yet available (local development only).

## Files modified

-
`src/frontend/src/content/docs/reference/cli/commands/aspire-doctor.mdx`
- `src/frontend/src/content/docs/get-started/prerequisites.mdx`

Both are updates to existing pages; no new pages were created.

> Generated by [PR Documentation
Check](https://github.com/microsoft/aspire/actions/runs/38792974448) for
#21004 · copilot · auto · 144.4 AIC · ⌖ 20.8 AIC · ⊞ 20.4K ·
[◷](https://github.com/search?q=repo%3Amicrosoft%2Faspire.dev+%22gh-aw-workflow-id%3A+pr-docs-check%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Documentation Check, engine: copilot,
model: auto, id: 38792974448, workflow_id: pr-docs-check, run:
https://github.com/microsoft/aspire/actions/runs/38792974448 -->

<!-- gh-aw-workflow-id: pr-docs-check -->
<!-- gh-aw-workflow-call-id: microsoft/aspire/pr-docs-check -->

Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
David Negstad (danegsta) added a commit that referenced this pull request Nov 6, 2026
…ts (#21009)

## Description

WSLc can run Aspire apps on Windows, but publishing currently has no
WSLc runtime implementation. This adds an initial, deliberately limited
publishing implementation so supported image operations use the selected
runtime and unsupported operations fail clearly instead of falling back
or working around WSLc limitations.

This PR targets `main` and builds on the runtime detection and doctor
support from #21004, now incorporated into `main`.

Supported on Windows: local Dockerfile builds without platform
selection, image tagging/removal/push, registry login, native JSON image
configuration inspection, and single-platform .NET SDK publishing to
WSLc's local image store. Auto-discovery retains Docker → Podman → WSLc
priority; explicit case-insensitive selection and custom keyed runtimes
remain supported.

Native SDK local publishing uses `LocalRegistry=Wslc` and requires an
SDK containing the WSLc support introduced in
[dotnet/sdk#55249](dotnet/sdk#55249). It was
verified with the repository-pinned SDK `11.0.100-rc.1.26425.128`; older
SDKs without this support report an unsupported registry rather than
falling back to another runtime. Aspire does not implement an
archive/load bridge.

Unsupported: Compose deployment/management, platform-selected Dockerfile
builds, Dockerfile archives/OCI format selection, manifest inspection,
multi-platform SDK publishing to WSLc's local image store, and
container-file layering (which requires a platform-selected Dockerfile
build). Multi-platform image loading is tracked by
[microsoft/WSL#41123](microsoft/WSL#41123).
These paths reject explicitly using existing exception/inspection-result
contracts. Daemon-free single- and multi-platform SDK archives remain
supported without WSLc health checks or commands; archive publishing
omits `LocalRegistry=Wslc`, preserving compatibility with SDKs that do
not recognize it. No alternative builder or runtime fallback is
introduced.

Dockerfile builds in Docker, Podman, and WSLc now use
`ProcessSpec.ArgumentList` instead of a manually quoted command line.
Shared eager argument helpers preserve quotes, spaces, backslashes,
empty values, and inherited environment values, retaining Podman's
existing secret behavior. Platform-specific process argument handling
remains owned by .NET, without invoking a shell.

### User-facing usage

On Windows, select WSLc with `ASPIRE_CONTAINER_RUNTIME=wslc`.
Single-platform .NET SDK publishing then uses WSLc's local store through
the SDK's native support.

Dockerfile publishing defaults to `linux/amd64`; explicitly opt into the
WSLc host platform only when appropriate:

```csharp
builder.AddDockerfile("program", "./program")
    .WithContainerBuildOptions(options => options.TargetPlatform = null);
```

For a .NET SDK archive without container-file layering:

```csharp
project.WithContainerBuildOptions(options =>
{
    options.Destination = ContainerImageDestination.Archive;
    options.OutputPath = "./images";
});
```

### Validation

- `.\restore.cmd /p:SkipNativeBuild=true` — passed during initial setup.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj
--no-launch-profile /p:SkipNativeBuild=true -- --filter-class
'*.WslcContainerRuntimeTests' --filter-class
'*.ContainerRuntimeResolverTests' --filter-class
'*.ContainerRuntimeDetectorTests' --filter-class
'*.DockerContainerRuntimeTests' --filter-class
'*.ContainerRuntimeBaseTests' --filter-class
'*.DotnetProgramArchiveTests' --filter-class
'*.DotnetProgramPublishingTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'` — passed, 151 tests after merging
`main`, before the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj
--no-launch-profile /p:SkipNativeBuild=true -- --filter-class
'*.ContainerRuntimeBaseTests' --filter-class
'*.DockerContainerRuntimeTests' --filter-class
'*.PodmanSaveArgumentsTests' --filter-class
'*.WslcContainerRuntimeTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'` — passed, 95 tests after the
argument-list correction and eager helper changes. The runtime-constant
follow-up was rebuilt with `--filter-method
'*.BuildImageAsync_PreservesArgumentBoundaries'` (same project and
exclusions) — passed, 3 cases. The complete 95-test selection was rerun
with `--no-build` immediately before pushing — passed.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-method '*.BuildSecretsFormats*'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` — passed, 4 tests after the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-class '*.DotnetProgramArchiveTests'
--filter-class '*.DotnetProgramPublishingTests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` — passed, 48
tests after the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-method '*.BuildImageAsync_Dotnet*'
--filter-method
'*.BuildImageAsync_ProjectBuildPassesResolvedContainerRuntimeAsLocalRegistry'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` — passed, 20 tests after the SDK correction and before
the `main` merge.
- `.\.dotnet\dotnet.exe publish '<probe-directory>\probe.csproj'
--configuration Release /t:PublishContainer
--property:LocalRegistry=Wslc
--property:ContainerRepository=aspire-wslc-sdk-probe-b35fa7a4
--property:ContainerImageTag=single
--property:RuntimeIdentifier=linux-x64
--property:ContainerRuntimeIdentifier=linux-x64
--property:ContainerBaseImage=mcr.microsoft.com/dotnet/runtime:10.0
--source https://packagefeedproxy.microsoft.io/nuget/v3/index.json` —
passed using a temporary minimal net10.0 console project and SDK
`11.0.100-rc.1.26425.128`. SDK reported successful publication via Wslc;
`wslc image inspect aspire-wslc-sdk-probe-b35fa7a4:single --format json`
confirmed linux/amd64. Probe image and project cleaned up; the path
above is a placeholder for that temporary directory.
- Installed WSLc 3.0.3.0: verified local Dockerfile build and native
`image inspect --format json`; inspected tag/remove/push/login/build
help and DCP's WSLc adapter. Direct `--output type=docker` and `--output
type=oci` probes both failed with the Docker-driver exporter limitation,
confirming the explicit archive boundary. Probe image/files cleaned up.
- Local E2E tests were not run; no E2E tests were added. Linux/macOS
execution and live registry push/login were not validated locally.
- Existing NU1902/NU1903 warnings for
`System.Security.Cryptography.Pkcs` 10.0.12 remain; no dependency
changes are included.

### Security considerations

The selected WSLc executable is trusted in the same way as
Docker/Podman. Image commands use the existing process runner; registry
passwords remain on stdin and environment build secrets follow the
existing runtime pattern. Native image inspection uses source-generated
JSON deserialization and preserves the image reference as a single
process argument. Dockerfile build invocations for all three runtimes
now preserve argument boundaries through `ProcessSpec.ArgumentList`. No
listener, elevated execution, archive extraction, or Aspire-managed
archive/load bridge is added. A separate security review has not been
performed.

Fixes # (issue)

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] 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
  - [x] 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
      - [x] No
  - [x] No

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
Copilot-Session: b35fa7a4-1433-4b70-9840-5f5866230ff4
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
…ts (#21009)

## Description

WSLc can run Aspire apps on Windows, but publishing currently has no
WSLc runtime implementation. This adds an initial, deliberately limited
publishing implementation so supported image operations use the selected
runtime and unsupported operations fail clearly instead of falling back
or working around WSLc limitations.

This PR targets `main` and builds on the runtime detection and doctor
support from #21004, now incorporated into `main`.

Supported on Windows: local Dockerfile builds without platform
selection, image tagging/removal/push, registry login, native JSON image
configuration inspection, and single-platform .NET SDK publishing to
WSLc's local image store. Auto-discovery retains Docker → Podman → WSLc
priority; explicit case-insensitive selection and custom keyed runtimes
remain supported.

Native SDK local publishing uses `LocalRegistry=Wslc` and requires an
SDK containing the WSLc support introduced in
[dotnet/sdk#55249](dotnet/sdk#55249). It was
verified with the repository-pinned SDK `11.0.100-rc.1.26425.128`; older
SDKs without this support report an unsupported registry rather than
falling back to another runtime. Aspire does not implement an
archive/load bridge.

Unsupported: Compose deployment/management, platform-selected Dockerfile
builds, Dockerfile archives/OCI format selection, manifest inspection,
multi-platform SDK publishing to WSLc's local image store, and
container-file layering (which requires a platform-selected Dockerfile
build). Multi-platform image loading is tracked by
[microsoft/WSL#41123](microsoft/WSL#41123).
These paths reject explicitly using existing exception/inspection-result
contracts. Daemon-free single- and multi-platform SDK archives remain
supported without WSLc health checks or commands; archive publishing
omits `LocalRegistry=Wslc`, preserving compatibility with SDKs that do
not recognize it. No alternative builder or runtime fallback is
introduced.

Dockerfile builds in Docker, Podman, and WSLc now use
`ProcessSpec.ArgumentList` instead of a manually quoted command line.
Shared eager argument helpers preserve quotes, spaces, backslashes,
empty values, and inherited environment values, retaining Podman's
existing secret behavior. Platform-specific process argument handling
remains owned by .NET, without invoking a shell.

### User-facing usage

On Windows, select WSLc with `ASPIRE_CONTAINER_RUNTIME=wslc`.
Single-platform .NET SDK publishing then uses WSLc's local store through
the SDK's native support.

Dockerfile publishing defaults to `linux/amd64`; explicitly opt into the
WSLc host platform only when appropriate:

```csharp
builder.AddDockerfile("program", "./program")
    .WithContainerBuildOptions(options => options.TargetPlatform = null);
```

For a .NET SDK archive without container-file layering:

```csharp
project.WithContainerBuildOptions(options =>
{
    options.Destination = ContainerImageDestination.Archive;
    options.OutputPath = "./images";
});
```

### Validation

- `.\restore.cmd /p:SkipNativeBuild=true` — passed during initial setup.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj
--no-launch-profile /p:SkipNativeBuild=true -- --filter-class
'*.WslcContainerRuntimeTests' --filter-class
'*.ContainerRuntimeResolverTests' --filter-class
'*.ContainerRuntimeDetectorTests' --filter-class
'*.DockerContainerRuntimeTests' --filter-class
'*.ContainerRuntimeBaseTests' --filter-class
'*.DotnetProgramArchiveTests' --filter-class
'*.DotnetProgramPublishingTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'` — passed, 151 tests after merging
`main`, before the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj
--no-launch-profile /p:SkipNativeBuild=true -- --filter-class
'*.ContainerRuntimeBaseTests' --filter-class
'*.DockerContainerRuntimeTests' --filter-class
'*.PodmanSaveArgumentsTests' --filter-class
'*.WslcContainerRuntimeTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'` — passed, 95 tests after the
argument-list correction and eager helper changes. The runtime-constant
follow-up was rebuilt with `--filter-method
'*.BuildImageAsync_PreservesArgumentBoundaries'` (same project and
exclusions) — passed, 3 cases. The complete 95-test selection was rerun
with `--no-build` immediately before pushing — passed.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-method '*.BuildSecretsFormats*'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` — passed, 4 tests after the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-class '*.DotnetProgramArchiveTests'
--filter-class '*.DotnetProgramPublishingTests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` — passed, 48
tests after the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-method '*.BuildImageAsync_Dotnet*'
--filter-method
'*.BuildImageAsync_ProjectBuildPassesResolvedContainerRuntimeAsLocalRegistry'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` — passed, 20 tests after the SDK correction and before
the `main` merge.
- `.\.dotnet\dotnet.exe publish '<probe-directory>\probe.csproj'
--configuration Release /t:PublishContainer
--property:LocalRegistry=Wslc
--property:ContainerRepository=aspire-wslc-sdk-probe-b35fa7a4
--property:ContainerImageTag=single
--property:RuntimeIdentifier=linux-x64
--property:ContainerRuntimeIdentifier=linux-x64
--property:ContainerBaseImage=mcr.microsoft.com/dotnet/runtime:10.0
--source https://packagefeedproxy.microsoft.io/nuget/v3/index.json` —
passed using a temporary minimal net10.0 console project and SDK
`11.0.100-rc.1.26425.128`. SDK reported successful publication via Wslc;
`wslc image inspect aspire-wslc-sdk-probe-b35fa7a4:single --format json`
confirmed linux/amd64. Probe image and project cleaned up; the path
above is a placeholder for that temporary directory.
- Installed WSLc 3.0.3.0: verified local Dockerfile build and native
`image inspect --format json`; inspected tag/remove/push/login/build
help and DCP's WSLc adapter. Direct `--output type=docker` and `--output
type=oci` probes both failed with the Docker-driver exporter limitation,
confirming the explicit archive boundary. Probe image/files cleaned up.
- Local E2E tests were not run; no E2E tests were added. Linux/macOS
execution and live registry push/login were not validated locally.
- Existing NU1902/NU1903 warnings for
`System.Security.Cryptography.Pkcs` 10.0.12 remain; no dependency
changes are included.

### Security considerations

The selected WSLc executable is trusted in the same way as
Docker/Podman. Image commands use the existing process runner; registry
passwords remain on stdin and environment build secrets follow the
existing runtime pattern. Native image inspection uses source-generated
JSON deserialization and preserves the image reference as a single
process argument. Dockerfile build invocations for all three runtimes
now preserve argument boundaries through `ProcessSpec.ArgumentList`. No
listener, elevated execution, archive extraction, or Aspire-managed
archive/load bridge is added. A separate security review has not been
performed.

Fixes # (issue)

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] 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
  - [x] 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
      - [x] No
  - [x] No

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
Copilot-Session: b35fa7a4-1433-4b70-9840-5f5866230ff4
(cherry picked from commit 64ba1eb)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
…ts (#21009)

## Description

WSLc can run Aspire apps on Windows, but publishing currently has no
WSLc runtime implementation. This adds an initial, deliberately limited
publishing implementation so supported image operations use the selected
runtime and unsupported operations fail clearly instead of falling back
or working around WSLc limitations.

This PR targets `main` and builds on the runtime detection and doctor
support from #21004, now incorporated into `main`.

Supported on Windows: local Dockerfile builds without platform
selection, image tagging/removal/push, registry login, native JSON image
configuration inspection, and single-platform .NET SDK publishing to
WSLc's local image store. Auto-discovery retains Docker → Podman → WSLc
priority; explicit case-insensitive selection and custom keyed runtimes
remain supported.

Native SDK local publishing uses `LocalRegistry=Wslc` and requires an
SDK containing the WSLc support introduced in
[dotnet/sdk#55249](dotnet/sdk#55249). It was
verified with the repository-pinned SDK `11.0.100-rc.1.26425.128`; older
SDKs without this support report an unsupported registry rather than
falling back to another runtime. Aspire does not implement an
archive/load bridge.

Unsupported: Compose deployment/management, platform-selected Dockerfile
builds, Dockerfile archives/OCI format selection, manifest inspection,
multi-platform SDK publishing to WSLc's local image store, and
container-file layering (which requires a platform-selected Dockerfile
build). Multi-platform image loading is tracked by
[microsoft/WSL#41123](microsoft/WSL#41123).
These paths reject explicitly using existing exception/inspection-result
contracts. Daemon-free single- and multi-platform SDK archives remain
supported without WSLc health checks or commands; archive publishing
omits `LocalRegistry=Wslc`, preserving compatibility with SDKs that do
not recognize it. No alternative builder or runtime fallback is
introduced.

Dockerfile builds in Docker, Podman, and WSLc now use
`ProcessSpec.ArgumentList` instead of a manually quoted command line.
Shared eager argument helpers preserve quotes, spaces, backslashes,
empty values, and inherited environment values, retaining Podman's
existing secret behavior. Platform-specific process argument handling
remains owned by .NET, without invoking a shell.

### User-facing usage

On Windows, select WSLc with `ASPIRE_CONTAINER_RUNTIME=wslc`.
Single-platform .NET SDK publishing then uses WSLc's local store through
the SDK's native support.

Dockerfile publishing defaults to `linux/amd64`; explicitly opt into the
WSLc host platform only when appropriate:

```csharp
builder.AddDockerfile("program", "./program")
    .WithContainerBuildOptions(options => options.TargetPlatform = null);
```

For a .NET SDK archive without container-file layering:

```csharp
project.WithContainerBuildOptions(options =>
{
    options.Destination = ContainerImageDestination.Archive;
    options.OutputPath = "./images";
});
```

### Validation

- `.\restore.cmd /p:SkipNativeBuild=true` — passed during initial setup.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj
--no-launch-profile /p:SkipNativeBuild=true -- --filter-class
'*.WslcContainerRuntimeTests' --filter-class
'*.ContainerRuntimeResolverTests' --filter-class
'*.ContainerRuntimeDetectorTests' --filter-class
'*.DockerContainerRuntimeTests' --filter-class
'*.ContainerRuntimeBaseTests' --filter-class
'*.DotnetProgramArchiveTests' --filter-class
'*.DotnetProgramPublishingTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'` — passed, 151 tests after merging
`main`, before the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj
--no-launch-profile /p:SkipNativeBuild=true -- --filter-class
'*.ContainerRuntimeBaseTests' --filter-class
'*.DockerContainerRuntimeTests' --filter-class
'*.PodmanSaveArgumentsTests' --filter-class
'*.WslcContainerRuntimeTests' --filter-not-trait 'quarantined=true'
--filter-not-trait 'outerloop=true'` — passed, 95 tests after the
argument-list correction and eager helper changes. The runtime-constant
follow-up was rebuilt with `--filter-method
'*.BuildImageAsync_PreservesArgumentBoundaries'` (same project and
exclusions) — passed, 3 cases. The complete 95-test selection was rerun
with `--no-build` immediately before pushing — passed.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-method '*.BuildSecretsFormats*'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` — passed, 4 tests after the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-class '*.DotnetProgramArchiveTests'
--filter-class '*.DotnetProgramPublishingTests' --filter-not-trait
'quarantined=true' --filter-not-trait 'outerloop=true'` — passed, 48
tests after the argument-list correction.
- `.\.dotnet\dotnet.exe test --project
tests\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj --no-build
--no-launch-profile -- --filter-method '*.BuildImageAsync_Dotnet*'
--filter-method
'*.BuildImageAsync_ProjectBuildPassesResolvedContainerRuntimeAsLocalRegistry'
--filter-not-trait 'quarantined=true' --filter-not-trait
'outerloop=true'` — passed, 20 tests after the SDK correction and before
the `main` merge.
- `.\.dotnet\dotnet.exe publish '<probe-directory>\probe.csproj'
--configuration Release /t:PublishContainer
--property:LocalRegistry=Wslc
--property:ContainerRepository=aspire-wslc-sdk-probe-b35fa7a4
--property:ContainerImageTag=single
--property:RuntimeIdentifier=linux-x64
--property:ContainerRuntimeIdentifier=linux-x64
--property:ContainerBaseImage=mcr.microsoft.com/dotnet/runtime:10.0
--source https://packagefeedproxy.microsoft.io/nuget/v3/index.json` —
passed using a temporary minimal net10.0 console project and SDK
`11.0.100-rc.1.26425.128`. SDK reported successful publication via Wslc;
`wslc image inspect aspire-wslc-sdk-probe-b35fa7a4:single --format json`
confirmed linux/amd64. Probe image and project cleaned up; the path
above is a placeholder for that temporary directory.
- Installed WSLc 3.0.3.0: verified local Dockerfile build and native
`image inspect --format json`; inspected tag/remove/push/login/build
help and DCP's WSLc adapter. Direct `--output type=docker` and `--output
type=oci` probes both failed with the Docker-driver exporter limitation,
confirming the explicit archive boundary. Probe image/files cleaned up.
- Local E2E tests were not run; no E2E tests were added. Linux/macOS
execution and live registry push/login were not validated locally.
- Existing NU1902/NU1903 warnings for
`System.Security.Cryptography.Pkcs` 10.0.12 remain; no dependency
changes are included.

### Security considerations

The selected WSLc executable is trusted in the same way as
Docker/Podman. Image commands use the existing process runner; registry
passwords remain on stdin and environment build secrets follow the
existing runtime pattern. Native image inspection uses source-generated
JSON deserialization and preserves the image reference as a single
process argument. Dockerfile build invocations for all three runtimes
now preserve argument boundaries through `ProcessSpec.ArgumentList`. No
listener, elevated execution, archive extraction, or Aspire-managed
archive/load bridge is added. A separate security review has not been
performed.

Fixes # (issue)

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] 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
  - [x] 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
      - [x] No
  - [x] No

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f85e4b06-371e-465a-8fd8-e635d14ec41f
Copilot-Session: b35fa7a4-1433-4b70-9840-5f5866230ff4
(cherry picked from commit 64ba1eb)
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aspire doctor doesn't account for WSL

4 participants