Skip to content
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

ubuntu-latest not respecting latest installed .NET SDK - Results in build error #11403

Open
2 of 16 tasks
thomhurst opened this issue Jan 16, 2025 · 1 comment
Open
2 of 16 tasks

Comments

@thomhurst
Copy link

Description

Here's my build. It's on a matrix to build on ubuntu, windows and mac.

As you can see, windows and mac pass. But ubuntu complains that it only has .NET 8 and not .NET 9.

However you can see in the step above I'm installing the .NET 9 SDK by doing:

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 9.0.x

That runs and says:

dotnet-install: Attempting to download using aka.ms link https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0.102/dotnet-sdk-9.0.102-linux-x64.tar.gz
dotnet-install: Remote file https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0.102/dotnet-sdk-9.0.102-linux-x64.tar.gz size is 210604728 bytes.
dotnet-install: Extracting archive from https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0.102/dotnet-sdk-9.0.102-linux-x64.tar.gz
dotnet-install: Downloaded file size is 210604728 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 9.0.102
dotnet-install: Adding to current process PATH: /usr/share/dotnet. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.

Then the next step is to run my .NET 9 app, and it fails with a .NET 8 SDK error:

Run sudo -E dotnet run -c Release --allCategories=Singleton
Error: /usr/lib/dotnet/sdk/8.0.111/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(166,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 9.0. Either target .NET 8.0 or lower, or use a version of the .NET SDK that supports .NET 9.0. Download the .NET SDK from https://aka.ms/dotnet/download [/home/runner/work/Inject.NET/Inject.NET/Benchmarks/Benchmarks.csproj]

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022
  • Windows Server 2025

Image version and build link

https://github.com/thomhurst/Inject.NET/actions/runs/12807345586/job/35707734799

Is it regression?

Yes

Expected behavior

https://github.com/thomhurst/Inject.NET/actions/runs/12738696095

Actual behavior

.NET 9 SDK is installed but isn't used when trying to run a .NET 9 app

Repro steps

Install .NET 9 SDK

Run .NET 9 app

@Prabhatkumar59
Copy link
Contributor

Hi @thomhurst - Thank you for bringing this issue to our attention. We will look into this issue closely and will update you after investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants