Support major.minor version format in global.json runtimes#16420
Open
Support major.minor version format in global.json runtimes#16420
Conversation
- Modified InstallDotNetCore.cs to detect two-part versions (e.g., "8.0", "10.0") - When a two-part version is detected, use -channel parameter instead of -version - Added IsTwoPartVersion helper method to validate major.minor format - Added comprehensive unit tests to validate the new functionality Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
- Added -channel parameter support to dotnet-install.sh and dotnet-install.ps1 - Modified tools.sh and tools.ps1 InstallDotNet functions to handle channel parameter - When channel is specified, use --channel instead of --version for dotnet-install - Updated logic to skip version-based path checks when using channel parameter Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
- Changed Exit to return in InstallDotNet function to properly exit the function instead of terminating the entire PowerShell session - This ensures proper error handling when a runtime is already installed Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
- Removed accidentally committed .nuget/nuget.exe build artifact - Added .nuget/nuget.exe to .gitignore to prevent future commits Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for major.minor in global.json for aspnetcore
Support major.minor version format in global.json runtimes
Dec 18, 2025
akoeplinger
reviewed
Dec 18, 2025
| Exit | ||
|
|
||
| # When using channel, we can't check for an existing installation by version | ||
| # since we don't know which version will be installed |
Member
There was a problem hiding this comment.
@mconnew would this be a problem for you? it means we'd run dotnet-install.ps1 everytime
Member
There was a problem hiding this comment.
@akoeplinger, would that only be when running restore? If running build -build doesn't trigger this, that would be fine.
Ari4ka
approved these changes
Dec 28, 2025
Ari4ka
approved these changes
Dec 28, 2025
mmitche
reviewed
Jan 5, 2026
.gitignore
Outdated
|
|
||
| # vscode python env files | ||
| .env No newline at end of file | ||
| .env.nuget/nuget.exe |
Contributor
Author
There was a problem hiding this comment.
Done. Reverted .gitignore to original state in commit 14016c4.
mmitche
reviewed
Jan 5, 2026
| */ | ||
| private bool IsTwoPartVersion(string versionString) | ||
| { | ||
| if (string.IsNullOrWhiteSpace(versionString)) |
- Removed .nuget/nuget.exe entry from .gitignore - Restored original .gitignore state Co-authored-by: mmitche <8725170+mmitche@users.noreply.github.com>
- Replaced string splitting logic with regex pattern matching - Added System.Text.RegularExpressions using statement - Pattern matches exactly two numeric parts separated by a dot (^\d+\.\d+$) - All tests still pass (12/12 version detection tests, 37/40 total tests) Co-authored-by: mmitche <8725170+mmitche@users.noreply.github.com>
mmitche
approved these changes
Jan 6, 2026
mconnew
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enables specifying major.minor versions (e.g., "8.0", "10.0") in global.json runtimes, which automatically installs the latest patch for that channel.
Changes
-channelparameter instead of-version-channelparameter support to dotnet-install.sh/ps1 and tools.sh/ps1Usage
{ "tools": { "runtimes": { "aspnetcore": ["8.0", "10.0"] } } }Three-part versions continue to work unchanged.
To double check:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.