Update devcontainer to support .NET 9 and .NET 10 - #1843
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR updates the repository devcontainer to support building/testing projects targeting net9.0 and net10.0 by switching from a fixed .NET 8 SDK image to a Dockerfile-based devcontainer build that includes .NET 10 and installs .NET 9 side-by-side.
Changes:
- Add a
.devcontainer/Dockerfilebased onmcr.microsoft.com/dotnet/sdk:10.0and install the .NET 9 SDK viadotnet-install.sh. - Update
.devcontainer/devcontainer.jsonto use"build"(Dockerfile) instead of a fixed"image".
Show a summary per file
| File | Description |
|---|---|
| .devcontainer/Dockerfile | Introduces a .NET 10-based devcontainer image and installs the .NET 9 SDK side-by-side. |
| .devcontainer/devcontainer.json | Switches devcontainer configuration from an image reference to a Dockerfile build. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Low
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (2)
.devcontainer/Dockerfile:1
- The base SDK image is referenced by a floating tag (
10.0). That can change over time (OS variant/patch), making the devcontainer build non-reproducible and potentially breaking contributors unexpectedly. Consider pinning to a more specific tag (e.g.,10.0.x-<distro>) or an image digest for determinism.
FROM mcr.microsoft.com/dotnet/sdk:10.0
.devcontainer/Dockerfile:11
global.jsonpins the SDK to8.0.100(global.json:3, with rollForward). Usingdotnet-install.sh --channel 8.0installs the latest 8.0 feature band instead of the version the repo requests, which can lead to unexpected SDK selection/drift across rebuilds. If the intent is to align withglobal.json, install the exact SDK version instead of the channel (and consider similarly pinning the 9.0 install if you want deterministic rebuilds).
/tmp/dotnet-install.sh --channel 9.0 --quality ga --install-dir /usr/share/dotnet --skip-non-versioned-files; \
/tmp/dotnet-install.sh --channel 8.0 --quality ga --install-dir /usr/share/dotnet --skip-non-versioned-files; \
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Low
Summary
.devcontainer/devcontainer.jsonfrom a fixed.NET 8image to a Dockerfile-based build.devcontainer/Dockerfilebased onmcr.microsoft.com/dotnet/sdk:10.0.NET 9 SDKside-by-side viadotnet-install.shWhy
The repository currently targets newer TFMs in CI and local workflows. This devcontainer update ensures contributors can build and test net9.0/net10.0 projects from the container environment.
Validation
.NET 9and.NET 10SDK availability is provisioned by container build steps