-
Notifications
You must be signed in to change notification settings - Fork 494
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
Incorrect Dotnet Version Displayed in GitHub Actions Workflow #504
Comments
Hello @adilhusain-s |
Hi @adilhusain-s, When an earlier version of the SDK is needed, you to specify that version in a global.json file. The process for selecting an SDK version is: Please refer this link for official reference. |
I think this should be considered a breaking change even though it isn't documented that way. My team's workflows are built with the assumption that only the dotnet version we requested will be installed. My team is rolling back to v2 because our workflows are now building code using the wrong .NET version. Either this change should be reverted, or it should be moved to the "breaking changes" section of the release notes. |
Hello @BrandonDusseau! The modifications are officially from .NET/Microsoft and not from setup-dotnet, hence they can't be classified as a breaking change. Please feel free to reach us if you face any other issues. |
@mahabaleshwars I'm not certain that's correct. When we used At this point in time we did not use It seems like v4 installing the latest LTS version (see #433 - I haven't taken a lot of time to try and interpret this PR so I may be wrong) may be related to this, but I'm not sure. Please correct me if I'm wrong, but I believe this is new setup-dotnet behavior and not a change on the Microsoft side. This does seem like a breaking behavior change for any projects not using 8.0+ and that do not have a global.json file present. |
Hello @BrandonDusseau! Here's what you can expect with setup-dotnet@v4: It ensures a minimal installation of the latest runtime version to get the most up-to-date stable dotnet executable. |
Hello @BrandonDusseau!, this is a polite reminder to verify if the suggested solution in the comment has addressed your issue. |
@mahabaleshwars apologies for the delayed response. Things have been quite busy over here! When we upgraded our projects to .NET 8 recently, the problem naturally resolved and I was able to upgrade to setup-dotnet v4. As part of that change I added What I really want to see come out of this issue is the release notes for v4 being updated to mark installing the LTS version as a breaking change, because that's what it is. Projects that are using a version of .NET earlier than the LTS and that are not using a Release notes are the primary documentation for users upgrading from previous versions of a tool. If I don't see anything obvious about the behavior changing between versions, I'm not likely to look at the readme again. I don't think I'm unusual in this sense. |
where you using setup-dotnet@v3 or v4 when this occurred? today I started having issues where all my projects won't build now, when they were hours ago, and are showing errors on pages that were not even modified. is this similar to what you were experiencing? |
I was using v4 at the time we were having problems. In our case, we were failing on our You can be sure if you add a |
Hello @BrandonDusseau! Appreciate your suggestion about the required change. We have now updated the release notes to specify that installing the LTS version is a breaking change. Hello @adilhusain-s, kindly review the provided response. It should address the problem you're experiencing. |
could you please update the official documentation for setup/dotnet action as per above discussion? |
Hi @adilhusain-s, the latest version, 8.0.1, is pre-installed on GitHub runners. You can view the changes in the release notes. If a previous version of the SDK is required, you can specify this in a global.json file. Please refer to the documentation where the use of global.json is explained. |
@mahabaleshwars |
Hello @adilhusain-s, thank you for your suggestion. However, the document you referred to is intended to guide users on installing multiple .NET versions. The specific .NET SDK version to be used is determined by the global.json file, not this document. Therefore, an update to this document may not be necessary at this time. For more comprehensive details, please refer to the setup-dotnet repository. we are now closing this issue since it has fulfilled its intent. Please feel free to reach us if you are facing any concerns. |
Description:
I was attempting to use multiple .NET versions in my GitHub Actions workflow, and I observed that the
dotnet --version
command consistently prints the version of .NET SDK 8.0, even though I specified other versions. I followed the official workflow example from the documentation, where it successfully uses 3.0 and 6.0 versions. However, in my workflow run (link: workflow run), it consistently displays the version as 8.0.Task version:
[Specify the task version]
Platform:
Runner type:
Steps to Reproduce:
Expected Behavior:
The
dotnet --version
command should correctly display the specified .NET versions in the workflow matrix.Actual Behavior:
The
dotnet --version
command consistently displays the version as 8.0.The text was updated successfully, but these errors were encountered: