-
Notifications
You must be signed in to change notification settings - Fork 488
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
Using dotnet-version: 7.0.x
installs .NET 8.0.x instead onf 7.0.x
#597
Comments
Hello @MikeSchulze👋, |
UPDATE: After an additional investigation it seems the issue with .NET Core SDK 2.0 is caused by an issue with download at source. I've opened an issue: .NET Core 2.0 SDK download links are mixed up with .NET Core 2.1 version I have run into similar issue. .NET Core SDK 2.0 is not installed. Instead, version 2.1 is. As this won't be a priority issue, I am just adding it here for people that might need to find a workaround. Description: Task version: actions/setup-dotnet@v3 Platform:
Runner type:
Expected behavior: All requested versions of SDK are installed correctly. YAML
Console Output
Workaround: To install all requested .NET SDKs, you can use
|
Hi @MikeSchulze, this is expected behavior with setup-dotnet@v4. Here's what you can expect: It ensures a minimal installation of the latest runtime version to provide the most up-to-date stable .NET executable. The first install script performs the download only once per workflow. If you need an earlier SDK version, you can specify it in a global.json file. For more details, refer to the setup-dotnet documentation. |
That's sounds strange, how can this the expected behavior? There is an option |
Hi @MikeSchulze, I would say, that @mahabaleshwars meant that in addition to requested version latest LTS version is installed. In your case version 7.0.410 is already installed. On top of that latest LTS is installed. |
Hi @MikeSchulze, In most GitHub runners, the pre-installed .NET SDK versions are 9.0.102 or a version from the 8.x series. You can find more details about the available runner images here. The .NET SDK commands include dotnet new and dotnet run. The .NET CLI always chooses an SDK version for each dotnet command, defaulting to the latest installed version on the machine. This occurs even if: The project targets an earlier version of the .NET runtime. The SDK selection process is as follows:
The global.json feature is indeed part of .NET itself and not specific to the setup-dotnet action. The global.json file is used by the .NET SDK to determine which version of the SDK to use. The dotnet-version parameter in the setup-dotnet action is used to specify the SDK version. If the required SDK version is different from the one installed by default in the runner image, the global.json file can be used to specify the required version. This ensures the correct SDK version is used during the workflow run. For more details, please refer to the official documentation here and global.json |
Description:
I added the
setup-dotnet
action to install Net 7.0.x if is required, but it installs the NET 8.0.xTask version:
actions/setup-dotnet@v4
Platform:
Runner type:
Repro steps:
Expected behavior:
I used a matrix and caching action behind, but the installation looks wrong.
https://github.com/MikeSchulze/gdUnit4-action/blob/50ab18fa8987997062e88fae49211bb751674e89/action.yml#L158
Actual behavior:
The text was updated successfully, but these errors were encountered: