-
Notifications
You must be signed in to change notification settings - Fork 376
Support major.minor version format in global.json runtimes #16420
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
base: main
Are you sure you want to change the base?
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>
| Exit | ||
|
|
||
| # When using channel, we can't check for an existing installation by version | ||
| # since we don't know which version will be installed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mconnew would this be a problem for you? it means we'd run dotnet-install.ps1 everytime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akoeplinger, would that only be when running restore? If running build -build doesn't trigger this, that would be fine.
.gitignore
Outdated
|
|
||
| # vscode python env files | ||
| .env | ||
| .env.nuget/nuget.exe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Reverted .gitignore to original state in commit 14016c4.
| */ | ||
| private bool IsTwoPartVersion(string versionString) | ||
| { | ||
| if (string.IsNullOrWhiteSpace(versionString)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please use a regex for this detection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use regex pattern ^\d+\.\d+$ for version detection in commit a9584e4.
- 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>
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.