aspire commands fail with exceptions when running on NixOS
- 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
Following the instructions for running the [Flake](https://aspire.dev/get-started/install-cli/#tab-panel-6041) on the NixOS operating system, a non-zero exit code and errors are returned when executing `new` and `run` commands. Logs show the execution failed with a "Could not start dynamically linked executable" error message.
### Expected Behavior
- The `new` command to execute, create a solution from a starter template and complete without errors.
- The `run` command to execute, run the solution and dashboard.
### Steps To Reproduce
## aspire new
1. Open a terminal on NixOS
2. Move into an empty directory
3. Execute the following command to create a new solution from a template
```nix
nix run github:microsoft/aspire#aspire-cli -- new aspire-ts-cs-starter --name AspireOnNixOs --output AspireOnNixOs --language csharp
```
The output below is returned
> โ Failed to search for packages. Exit code: 127.
> ๐ See logs at /home/cp/.aspire/logs/cli_20260827T181022_60cf9a14.log
Where the log file contains the error
> [2026-08-27 18:10:22.594] [FAIL] [BundleNuGetPackageCache] NuGet search stderr: Could not start dynamically linked executable: /home/cp/.aspire/versions/13.4.6_87fe259e4fc244c599019a7b1304c85a1488f248-f4eed37ba65efd70/managed/aspire-managed
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see: https://nix.dev/permalink/stub-ld
## aspire run
1. Open a terminal on NixOS
2. Move into a directory where `aspire new` has completed successfully
3. Execute the following command to run the solution
```nix
nix run github:microsoft/aspire#aspire-cli -- run
```
The command fails with exit code 134 and output
```
AspireOnNixOs/AspireOnNixOs.AppHost/AspireOnNixOs.AppHost.csproj
โ ๏ธ Developer certificates may not be fully trusted (trust exit code was: PartiallyFailedToTrustTheCertificate).
โน๏ธ Recent AppHost startup output:
Unhandled exception. System.AggregateException: One or more errors occurred. (Application orchestrator dependency check returned an error: 'dcp info' returned exit code 127. Could not start dynamically linked executable:
/home/cp/.aspire/versions/13.4.6_87fe259e4fc244c599019a7b1304c85a1488f248-f4eed37ba65efd70/dcp/dcpNixOS cannot run dynamically linked executables intended for genericlinux environments out of the box. For more information,
see:https://nix.dev/permalink/stub-ld
)
---> Aspire.Hosting.DistributedApplicationException: Application orchestrator dependency check returned an error: 'dcp info' returned exit code 127. Could not start dynamically linked executable:
/home/cp/.aspire/versions/13.4.6_87fe259e4fc244c599019a7b1304c85a1488f248-f4eed37ba65efd70/dcp/dcpNixOS cannot run dynamically linked executables intended for genericlinux environments out of the box. For more information,
see:https://nix.dev/permalink/stub-ld
at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(Boolean force, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 88
at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(Boolean force, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 130
at Aspire.Hosting.Dcp.DcpHost.EnsureDcpContainerRuntimeAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHost.cs:line 89
at Aspire.Hosting.Dcp.DcpHost.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHost.cs:line 80
at Aspire.Hosting.Orchestrator.OrchestratorHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Orchestrator/OrchestratorHostService.cs:line 39
at Microsoft.Extensions.Hosting.Internal.Host.b__14_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
at Microsoft.Extensions.Hosting.Internal.Host.g__LogAndRethrow|14_3(<>c__DisplayClass14_0&)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 546
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Aspire.Hosting.DistributedApplication.Run() in /_/src/Aspire.Hosting/DistributedApplication.cs:line 588
at Program.$(String[] args) in /home/cp/aspire-bug/AspireOnNixOs/AspireOnNixOs.AppHost/AppHost.cs:line 13
```
### Exceptions (if any)
## aspire run
```
Unhandled exception. System.AggregateException: One or more errors occurred. (Application orchestrator dependency check returned an error: 'dcp info' returned exit code 127. Could not start dynamically linked executable:
/home/cp/.aspire/versions/13.4.6_87fe259e4fc244c599019a7b1304c85a1488f248-f4eed37ba65efd70/dcp/dcpNixOS cannot run dynamically linked executables intended for genericlinux environments out of the box. For more information,
see:https://nix.dev/permalink/stub-ld
)
---> Aspire.Hosting.DistributedApplicationException: Application orchestrator dependency check returned an error: 'dcp info' returned exit code 127. Could not start dynamically linked executable:
/home/cp/.aspire/versions/13.4.6_87fe259e4fc244c599019a7b1304c85a1488f248-f4eed37ba65efd70/dcp/dcpNixOS cannot run dynamically linked executables intended for genericlinux environments out of the box. For more information,
see:https://nix.dev/permalink/stub-ld
at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(Boolean force, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 88
at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(Boolean force, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 130
at Aspire.Hosting.Dcp.DcpHost.EnsureDcpContainerRuntimeAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHost.cs:line 89
at Aspire.Hosting.Dcp.DcpHost.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHost.cs:line 80
at Aspire.Hosting.Orchestrator.OrchestratorHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Orchestrator/OrchestratorHostService.cs:line 39
at Microsoft.Extensions.Hosting.Internal.Host.b__14_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
at Microsoft.Extensions.Hosting.Internal.Host.g__LogAndRethrow|14_3(<>c__DisplayClass14_0&)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 546
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Aspire.Hosting.DistributedApplication.Run() in /_/src/Aspire.Hosting/DistributedApplication.cs:line 588
at Program.$(String[] args) in /home/cp/aspire-bug/AspireOnNixOs/AspireOnNixOs.AppHost/AppHost.cs:line 13
```
### Aspire doctor output
```plain
Aspire Environment Check
========================
Aspire
โ ๏ธ Aspire CLI version 13.4.6 (channel: stable)
Details:
Could not check for Aspire CLI updates: Failed to search for packages. Exit code: 127.
.NET SDK
โ
.NET 10.0.302 installed (x64)
Container Runtime
โ
Docker v29.6.2: running (auto-detected (default)) โ active
Environment
โ ๏ธ HTTPS development certificate is only partially trusted
Set SSL_CERT_DIR in your shell profile: export SSL_CERT_DIR="$SSL_CERT_DIR:/home/cp/.aspnet/dev-certs/trust"
See: https://aka.ms/aspire-prerequisites#dev-certs
Details:
The certificate is in the trusted store, but SSL_CERT_DIR is not configured to include '/home/cp/.aspnet/dev-certs/trust'. Some applications may not trust the certificate. 'aspire run' will configure this automatically.
Summary: 2 passed, 2 warnings, 0 failed
For detailed prerequisites: https://aka.ms/aspire-prerequisites
Aspire CLI Installations
========================
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโฌโโโโโโโโโโโโโโฎ
โ Path โ Version โ Channel โ Route โ PATH status โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโผโโโโโโโโโโโโโโค
โ /nix/store/kl6zb9ha4d0klk3girmh292jz5754wxr-aspire-cli-13.4.6/lib/aspire-cli/aspire (current) โ 13.4.6+87fe259e4fc244c599019a7b1304c85a1488f248 โ stable โ nix โ not on PATH โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโดโโโโโโโโโโโโโโฏ
```
### Anything else?
**Operating System:** Linux NixOS 26.05
**.NET version:** 10.0.302
### Nix .NET SDK configuration
```nix
{ pkgs, ... }:
let
dotnet-sdk = pkgs.dotnet-sdk_10;
in
{
environment.systemPackages = [
dotnet-sdk
];
environment.variables = {
DOTNET_ROOT = "${dotnet-sdk}/share/dotnet";
DOTNET_ROLL_FORWARD_TO_PRERELEASE = "1";
DOTNET_CLI_TELEMETRY_OPTOUT = "1";
};
}
```
### Workarounds
The commands succeed when prepending `aspire` with `steam-run`, or using the modified `eng/nix/package.nix` below that uses a FHS environment
```nix
{
lib,
stdenv,
fetchurl,
buildFHSEnv,
icu,
openssl,
zlib,
nss,
manifest ? builtins.fromJSON (builtins.readFile ./versions.json),
}:
let
system = stdenv.hostPlatform.system;
entry =
manifest.systems.${system}
or (throw "Aspire CLI does not publish a Nix package for system '${system}'.");
in
buildFHSEnv {
pname = "aspire";
inherit (manifest) version;
targetPkgs = pkgs: [
icu
openssl
zlib
nss.tools
stdenv.cc.cc.lib
];
multiPkgs = pkgs: [ ];
runScript = "/opt/aspire-cli/aspire";
extraBuildCommands = ''
mkdir -p "$out/opt/aspire-cli"
tar -xf ${
fetchurl {
inherit (entry) url hash;
}
} -C "$out/opt/aspire-cli" --strip-components=1
chmod 755 "$out/opt/aspire-cli/aspire"
# The install marker file expected by Aspire
printf '%s\n' '{"source":"nix"}' > "$out/opt/aspire-cli/.aspire-install.json"
'';
passthru = {
inherit manifest;
inherit (entry) archiveName rid;
};
meta = {
description = "Command line tool for Aspire developers";
homepage = "https://aspire.dev";
changelog = "https://github.com/microsoft/aspire/releases/tag/${manifest.releaseTag}";
license = lib.licenses.mit;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = builtins.attrNames manifest.systems;
mainProgram = "aspire";
};
}
```
Contributor guide
Research direction
Start with eng/nix/package.nix and the documented Flake install path, then reproduce both aspire new and aspire run on NixOS to compare the dynamic-linker failures. Use the reported steam-run and buildFHSEnv workarounds as comparison points; done means both commands complete without the executable-start errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, nixos
- Domain
- build-system, cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100