microsoft / microsoft/aspire

DNX Acquisition Mode fails when offline

Open
#19,717 2 comments 1 reaction 0 assignees View on GitHub
area-acquisition area-cli triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

If you configure `AspireCliInvocationMode` to use DNX, the `dotnet run` will fail if you have no network connectivity. This is probably root caused by dotnet/sdk#50579 .

### Expected Behavior

Aspire should be able fall back to CLI versions previosuly acquired by DNX

### Steps To Reproduce

1. Enable dnx invocation
```

true
DnxPinned

```
2. Turn on flight mode / turn off wifi / unplug all ethernet connections.

### Exceptions (if any)

dotnet run
```
> dotnet run --project .\app\REDACTED.AppHost\
Using launch settings from .\app\REDACTED.AppHost\Properties\launchSettings.json...
Building...
failed with 1 error(s) (6.8s)
S:\_packages\nuget\aspire.hosting.apphost\13.5.3\build\Aspire.Hosting.AppHost.targets(558,5): error DNX could not restore or run aspire.cli@13.5.3 (exit code 1). Run '"C:\Program Files\dotnet\dotnet.exe" exec "C:\Program Files\dotnet\sdk\10.0.303\dotnet.dll" dnx --yes aspire.cli@13.5.3 -- --version' to diagnose package sources, authentication, or connectivity.
Running the ComputeRunArguments target to discover run commands failed for this project. Fix the errors and warnings and run again.
```

Calling dnx manually
```
> &"C:\Program Files\dotnet\dotnet.exe" exec "C:\Program Files\dotnet\sdk\10.0.303\dotnet.dll" dnx --yes aspire.cli@13.5.3 -- --version
Unhandled exception: Unable to load the service index for source https://REDACTED/nuget/index.json.
```
But 13.5.3 does exist, so DNX ought to be able to use it.

```
> dir $env:NUGET_PACKAGES\aspire.cli

Directory: S:\_packages\nuget\aspire.cli

Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 26/08/2026 18:40  13.5.3
```

### Aspire doctor output

```plain
N/A
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce with AspireUseCliBundle=true and AspireCliInvocationMode=DnxPinned, then run dotnet run while offline and inspect the DNX invocation reported in Aspire.Hosting.AppHost.targets. Done means a previously acquired aspire.cli version can be used without network connectivity, with coverage for the offline case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.