Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR outlines the basic proposals for the v2 version of setup-dotnet.
Internal issue: 1807
comment:
To summarize the current behavior for .NET team review
We have a bunch of .NET Core versions pre-installed on images. And the problem is that action works very inconsistent on different platforms.
Pre-installed location (where .NET is pre-installed): “/usr/share/dotnet”
Action installs to: “/home/runner/.dotnet”
Pre-installed location: “C:\Program Files\dotnet”
Action installs to “C:\Users\runneradmin\AppData\Local\Microsoft\dotnet”
Pre-installed location: “/Users/runner/.dotnet”
Action installs to “/Users/runner/.dotnet”
How it works currently on macOS
Pre-installed location and action location are the same. It means that if we have versions
2.1.x
,3.1.x
and5.0.x
pre-installed on image and user will install 3.1 via action, installation will be skipped because version already exists. if customer runsdotnet --version
it will report version 5.x if customer doesn't have global.json (because both 2.1, 3.1, 5.0 will be located in the same folder anddotnet
will choose the latest one based on https://docs.microsoft.com/en-us/dotnet/core/versions/selection)How it works currently on Windows / Ubuntu
Pre-installed location and action location are different. It means if we have versions
2.1.x
,3.1.x
and5.0.x
pre-installed on image and user will install 3.1 via action, version 3.1 will be installed to the separate location anddotnet --version
will report version 3.1 because it is the single version installed in that location.Problems
Behavior is inconsistent between platforms and it confuses users
macOS users complain that dotnet still uses 5.x despite the fact that they invoked action with 3.1
Windows / Ubuntu users complain that pre-installed .NET are not consumed and it is always installed that takes build time
In our understand, the correct behavior is on macOS right now.
The new versions should be installed in the same location like pre-installed. It is expected behavior that
dotnet --version
will point the latest one and we should just point customers to documentation.