Skip to content

How to specify .NET version? #6

Open
@jongalloway

Description

@jongalloway

Since .NET Aspire includes support for current and previous .NET version (currently .NET 8 and .NET 9), this feature should allow specifying previous .NET version. After adding to dotnet/aspire-samples, I'm seeing that several samples specify .NET 8 and won't run without additional install for that version.

I see that .NET is specified using dependsOn dotnet. The best workaround in that specific case is to just also include the dotnet feature specifically and include an additionalVersion I think, but this seems like a common use case which would be important to include in the aspire-devcontainer feature.

Repro:

  1. Open devcontainer on dotnet/aspire-samples
  2. Execute ./build.sh
  3. Execute dotnet run --project samples/AspireWithPython/AspireWithPython.AppHost/AspireWithPython.AppHost.csproj

Output:

Using launch settings from samples/AspireWithPython/AspireWithPython.AppHost/Properties/launchSettings.json...
Building...
You must install or update .NET to run this application.

App: /workspaces/aspire-samples/samples/AspireWithPython/AspireWithPython.AppHost/bin/Debug/net8.0/AspireWithPython.AppHost
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: /usr/share/dotnet

The following frameworks were found:
  9.0.2 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  9.0.3 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=x64&rid=linux-x64&os=debian.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions