dennisdoomen / dennisdoomen/dotnet-library-starter-kit

[Bug]: The generated GitHub Actions workflow installs the wrong .NET SDKs

Open Beginner friendly
#98 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
77
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### Description

The `build.yml` workflow in `templates/Source/.github/workflows/` asks `actions/setup-dotnet` to install SDK versions `3.0.x` and `6.0.x`. But the generated `global.json` pins the SDK to `10.0.100` and the projects target `net10.0`. So the workflow installs SDKs that the build does not use, and does not install the one it needs.

The build currently only survives because the GitHub-hosted runner image happens to ship a recent SDK, plus `rollForward: latestMajor` in `global.json`. That is luck, not intent, and it breaks as soon as the runner image changes.

### Reproduction Steps

1. Generate a solution with `dotnet new oss-nuget-class-library-sln --name MyLib`.
2. Push it to GitHub and let the `Build` workflow run.
3. Look at the `Setup .NET SDKs` step.

### Expected behavior

The workflow installs the SDK version matching `global.json` (and any additional SDKs needed for the older target frameworks).

### Actual behavior

It installs .NET 3.0 and .NET 6.0, neither of which matches `global.json` or any target framework.

### Other information

Related: the *Building* section of the root `README.md` still tells people they need the SDKs for .NET 4.7, 6.0 and 8.0, which is also out of date.

Consider driving the version from `global.json` directly with `global-json-file: global.json` so the two can never drift apart again.

Contributor guide

Open the contributing guide

Research direction

Start with templates/Source/.github/workflows/build.yml and compare its Setup .NET SDKs step with global.json and the net10.0 project targets. Check the Building section of README.md for the related version guidance. Done means the generated workflow installs the pinned SDK and any required additional SDKs, and the README no longer lists outdated versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, github-actions
Domain
build-system, ci-cd, documentation
Issue type
Bug
Difficulty
2/5
Estimated time
Half a day
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.