-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Comments
Hi @thomhurst - Thank you for bringing this issue to our attention. We will look into this issue closely and will update you after investigating. |
It's happening on another repo of mine too if it's helpful: https://github.com/thomhurst/TUnit/actions/runs/12848634548/job/35826224078 |
Is the Because it does say that the PATH change is not exported. So if you are running the |
Hi @thomhurst, We have added the .NET 9 version to both Ubuntu 20 and Ubuntu 22. Kindly check the PR. However, for Ubuntu 24, .NET 9 is not yet available in the package manager as it is currently not supported in the built-in Ubuntu feed. If needed, you can install it manually, use backports, or utilize setup-dotnet. For more information, please read the complete documentation. We are closing this issue, Thank you. |
I am installing it manually. If you look at my post I'm using the setup dotnet action |
You think the sudo is breaking it? It used to run fine which is strange. I'll try it without sudo and see |
That did indeed resolve it. Thanks! |
This issue still persist for me. Do I need to add a sudo somewhere? |
I had to remove a sudo |
I never needed to use sudo and I still don't use it, and the actions is still failing as of now. |
The main thing that made the But if you run anything else (whether If this is what is affecting you, the solution would be to issue export PATH before the rest of your commands to make sure they see and use the updated version. You may also need to export some other values like (Also, @Odonno, saying only "it doesn't work for me" when you were not using |
I will try this. Thank you for your explanation.
To be honest, I am doing anything fancy and I was expecting more people to have issues with the recent update to Ubuntu 24 (or maybe the roll forward isn't GA for everyone yet?). Anyway, I was curious to know the reason and I am still not sure to understand it yet. I can give you some concrete for a change. Here is what my CI workflow looks like: jobs:
runs-on: ubuntu-4cores
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Install .NET tools
run: dotnet tool restore
- name: Check Formatting
run: dotnet csharpier --check .
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore This workflow fails at the Hope it brings sufficient information about my problem. |
OK. I upgraded csharpier to the latest version and now it works fine. I suspect this is due to the preinstalled version of .NET that is now higher than the ones in Ubuntu 22.
Sorry for the trouble @Zastai |
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:
That runs and says:
Then the next step is to run my .NET 9 app, and it fails with a .NET 8 SDK error:
Platforms affected
Runner images affected
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
The text was updated successfully, but these errors were encountered: