You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recognize WSLc in Aspire doctor and clarify runtime selection - #21004
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
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.
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.
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.
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.
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>
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.
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>
…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
…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)
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
aspire doctorcurrently 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
Example runtime output with multiple installed runtimes:
With WSLc explicitly configured:
Validation
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).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).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.Fixes: #20900
Checklist
<remarks />and<code />elements on your triple slash comments?