microsoft / microsoft/aspire-devcontainer-feature

How to specify .NET version?

Open
#6 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
10
Forks
10
Avg merge
6h 47m
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how the aspire-devcontainer feature handles dependsOn dotnet, then compare it with the additionalVersion workaround described in the issue. Reproduce the failure in dotnet/aspire-samples with ./build.sh and the AspireWithPython project; done means the .NET 8 sample runs alongside the available .NET 9 installation without an extra manual install.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.