Skip to content

Supporting dotnet 10.0 preview version #1305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ This Feature installs the latest .NET SDK, which includes the .NET CLI and the s
| aspNetCoreRuntimeVersions | Enter additional ASP.NET Core runtime versions, separated by commas. Use 'latest' for the latest version, 'lts' for the latest LTS version, 'X.Y' or 'X.Y.Z' for a specific version. | string | - |
| workloads | Enter additional .NET SDK workloads, separated by commas. Use 'dotnet workload search' to learn what workloads are available to install. | string | - |

The dotnet '10.0' option currently points to the '10.0-preview' version of dotnet. The dotnet '10.0' stable version is expected to be released by end of 2025. The preview version is still under development and is generally not supported for production use.

## Customizations

### VS Code Extensions
Expand Down
4 changes: 3 additions & 1 deletion src/dotnet/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "dotnet",
"version": "2.2.1",
"version": "2.3.0",
"name": "Dotnet CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/dotnet",
"description": "This Feature installs the latest .NET SDK, which includes the .NET CLI and the shared runtime. Options are provided to choose a different version or additional versions.",
Expand All @@ -11,6 +11,8 @@
"latest",
"lts",
"none",
// This below dotnet 10 is the dotnet 10.0-preview version. Please check the readme file for more details.
"10.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change it to 10.0-preview?

Copy link
Contributor Author

@Kaniska244 Kaniska244 May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @eljog ,

The url https://builds.dotnet.microsoft.com/dotnet/Sdk/ used in dotnet feature to download the installation package, expects this version 10 to be passed on as 10.0 in the same way like other versions. The only way to label it as preview version would be possible if the exact version is provided like 10.0.100-preview.3.25201.16.

Whereas in case of the dotnet devcontainer image, the base image is downloaded from mcr.microsoft.com/dotnet/ registry where the dotnet 10 versions are actuality labeled as 10.0-preview for e.g. mcr.microsoft.com/dotnet/sdk:10.0-preview-trixie-slim. Thats why it was possible there to label the version as 10.0-preview for the image.

So in case of the dotnet feature if we want to change the version from 10.0 to 10.0-preview, we will need a small customization in the feature to remove the preview part from the version parameter & use it in the script. Kindly let me know if we should do something like that for this PR.

With Regards,
Kaniska

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @eljog ,

As discussed, I have added comments to point out the dotnet 10.0 version offered is basically 10.0-preview version which marks it to be under development & its not recommended for production use. Would you kindly review the same.

With Regards,
Kaniska

"8.0",
"7.0",
"6.0"
Expand Down
1 change: 1 addition & 0 deletions src/dotnet/scripts/vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ dotnet-install.sh [--version latest] --channel 6.0 [--quality GA]
dotnet-install.sh [--version latest] --channel 6.0.4xx [--quality GA]
dotnet-install.sh [--version latest] --channel 8.0 --quality preview
dotnet-install.sh [--version latest] --channel 8.0 --quality daily
dotnet-install.sh [--version latest] --channel 10.0 --quality preview
dotnet-install.sh --version 6.0.413
```
20 changes: 4 additions & 16 deletions test/dotnet/install_dotnet_multiple_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ is_dotnet_sdk_version_installed "8.0"
check ".NET SDK 7.0 installed" \
is_dotnet_sdk_version_installed "7.0"

check ".NET SDK 6.0 installed" \
is_dotnet_sdk_version_installed "6.0"

check ".NET SDK 5.0 installed" \
is_dotnet_sdk_version_installed "5.0"

check ".NET Core SDK 3.1 installed" \
is_dotnet_sdk_version_installed "3.1"
check ".NET SDK 10.0 installed" \
is_dotnet_sdk_version_installed "10.0"

check "Build example class library" \
dotnet build projects/multitargeting
Expand All @@ -43,14 +37,8 @@ dotnet run --project projects/net8.0
check "Build and run .NET 7.0 project" \
dotnet run --project projects/net7.0

check "Build and run .NET 6.0 project" \
dotnet run --project projects/net6.0

check "Build and run .NET 5.0 project" \
dotnet run --project projects/net5.0

check "Build and run .NET Core 3.1 project" \
dotnet run --project projects/netcoreapp3.1
check "Build and run .NET 10.0 project" \
dotnet run --project projects/net10.0

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down
6 changes: 3 additions & 3 deletions test/dotnet/install_dotnet_specific_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ source dev-container-features-test-lib
source dotnet_env.sh
source dotnet_helpers.sh

expected=$(fetch_latest_version_in_channel "3.1")
expected=$(fetch_latest_version_in_channel "8.0")

check ".NET Core SDK 3.1 installed" \
check ".NET Core SDK 8.0 installed" \
is_dotnet_sdk_version_installed "$expected"

check "Build and run example project" \
dotnet run --project projects/netcoreapp3.1
dotnet run --project projects/net8.0

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ source dev-container-features-test-lib
source dotnet_env.sh
source dotnet_helpers.sh

check ".NET SDK 5.0.3xx installed" \
is_dotnet_sdk_version_installed "5.0.3"
check ".NET SDK 8.0.3xx installed" \
is_dotnet_sdk_version_installed "8.0.3"

check "Build and run example project" \
dotnet run --project projects/net5.0
dotnet run --project projects/net8.0

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down
32 changes: 32 additions & 0 deletions test/dotnet/projects/net10.0/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Newtonsoft.Json;

string json = """
{
"Name": "Inception",
"ReleaseDate": "2010-07-08T00:00:00",
"Genres": [
"Action",
"Thriller"
]
}
""";

Movie? m = JsonConvert.DeserializeObject<Movie>(json);

if (m == default)
{
Console.WriteLine("Decoding failed!");
}
else
{
Console.WriteLine($"Movie name: {m.Name}");
Console.WriteLine($"Release Date: {m.ReleaseDate}");
Console.WriteLine($"Genres: {string.Join(", ", m.Genres)}");
}

class Movie(string? name, DateTime releaseDate, List<string>? genres)
{
public string Name { get; set; } = name ?? "Default Name";
public DateTime ReleaseDate { get; set; } = releaseDate;
public List<string> Genres { get; set; } = genres ?? [];
}
14 changes: 14 additions & 0 deletions test/dotnet/projects/net10.0/example_project.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

</Project>
16 changes: 7 additions & 9 deletions test/dotnet/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
}
},
"install_dotnet_specific_release": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-20.04",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"remoteUser": "vscode",
"features": {
"dotnet": {
"version": "3.1"
"version": "8.0"
}
}
},
"install_dotnet_specific_release_and_feature_band": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-20.04",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"remoteUser": "vscode",
"features": {
"dotnet": {
"version": "5.0.3xx"
"version": "8.0.3xx"
}
}
},
Expand All @@ -40,13 +40,11 @@
"remoteUser": "vscode",
"features": {
"dotnet": {
"version": "9.0",
"version": "10.0",
"additionalVersions": [
"9.0",
"8.0",
"7.0",
"6.0",
"5.0",
"3.1"
"7.0"
]
}
}
Expand Down