-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Document breaking change: dotnet.acquire API no longer always downloads latest #49618
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
Conversation
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
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.
Pull Request Overview
This PR documents a breaking change in the .NET Install Tool for VS Code Extension version 3.0.0, which modifies the behavior of the dotnet.acquire API command to optimize startup performance by deferring runtime version checks.
Key changes:
- Adds new breaking change documentation for the .NET Install Tool's
dotnet.acquireAPI behavior modification - Updates the table of contents and .NET 10 compatibility index to include the new breaking change entry
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md | New breaking change documentation describing behavior changes in dotnet.acquire API |
| docs/core/compatibility/toc.yml | Adds new "Install tool" section with link to the breaking change article |
| docs/core/compatibility/10.0.md | Adds new "Install tool" section in the .NET 10 compatibility index table |
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
|
I'm good with the warning. It doesn't like the folder name 3.0.0 but we've named folders based on versions like that for a long time. |
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.
This LGTM @gewarren
We should fix the one warning though.
| @@ -0,0 +1,70 @@ | |||
| --- | |||
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.
It looks like the warning is coming from the folder name. That should be addressed.
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.
Thanks for the review @BillWagner. Can you take a look at my comment at #49618 (comment) and see if you agree?
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
docs/core/compatibility/install-tool/3.0.0/vscode-dotnet-acquire-no-latest.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Noah Gilson <noahgilson@microsoft.com>
The .NET Install Tool v3.0.0 changed
dotnet.acquirebehavior from always checking for latest runtime to using existing installations with periodic updates.Changes
docs/core/compatibility/extensions/10.0/vscode-dotnet-acquire-no-latest.mddotnet.acquireanddotnet.uninstallAPIsforceUpdate: trueworkaround for forcing latest versiontoc.ymland10.0.mdKey behavioral changes
Before v3.0.0: Always checked for latest runtime version on each call
After v3.0.0: Reuses existing installations, checks daily after
runtimeUpdateDelaySecondsExample usage:
Performance impact: Eliminates 287ms median delay (up to 9-36s for slowest 3% of networks)
Fixes #<issue_number>
Original prompt
This section details on the original issue you should resolve
<issue_title>[Breaking change]:
dotnet.acquireAPI for VS Code No Longer Always Downloads Latest</issue_title><issue_description>### Description
As implemented in dotnet/vscode-dotnet-runtime#2420 and described in dotnet/vscode-dotnet-runtime#2359, The .NET Install Tool Extension (https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime) for VS Code Extension Developers provides the VS Code command
dotnet.acquireto install a .NET runtime given amajor.minor, amongst other information such as anarchitecture. Some of the commands are documented at https://github.com/dotnet/vscode-dotnet-runtime/blob/main/Documentation/commands.md.Example of how a VS Code Extension may install the runtime using our extension:
const dotnetRuntimePath = (await vscode.commands.executeCommand<IDotnetAcquireResult>('dotnet.acquire', { version: '9.0', 'requestingExtensionId'})).dotnetPath;The commands for
dotnet.acquireanddotnet.uninstallwere both changed.dotnet.acquireno longer downloads the latest runtime each time and will instead periodically manage, update, and uninstall runtime versions.dotnet.uninstallwill no longer allow uninstalling an install that is 'in-use' which is defined below.Version
Other (please put exact version in description textbox)
Previous behavior
Up until version
3.0.0of the .NET Install Tool, or pre-release version2.4.1, callingdotnet.acquirewould always trigger a check to see what the latest runtime version was, given the user was online and did not specify any settings to do otherwise. If that latest runtime was not available on the machine, it would be installed, and the path to it would be returned.This runtime is used for C#DevKit, C#, and other VS Code extensions, both first and third party, to run internal C# code/processes, such as the language server host. This runtime is generally not used to run the users specific project, and is a private, user-folder copy on disk. It may be the runtime or aspnetcore runtime.
A similar command,
dotnet.uninstallexists and is also documented above. That command would uninstall any dotnet runtime or SDK that an extension had requested if no other extensions depended upon that installation. By depend on, we mean that an extension had requested that version of .NET in the past. This was a reference count-based mechanism to allow uninstallation when no further dependent extensions of an install remained.New behavior
As part of a change to improve performance and management of the .NET Runtime:
dotnet.acquirewill no longer always check for a newer runtime version before returning path to a runtime that matches themajor.minor. It will instead use existing runtime installations it's made and check daily for a new runtime afterruntimeUpdateDelaySeconds, which defaults to 5 minutes. This is a setting that can be changed in the VS Code Extension Settings. After this time, the prior check will commence for newer runtime versions, and the new runtime will be installed if needed. After this, all remaining .NET runtimes that are not 'in-use' and are not the latest patch for a specificmajor.minor,architecture, andmode(runtimevsaspnetcore[runtime]) combo will be uninstalled automatically.'in-use' means that the executable path to that .NET runtime install was:
a. Returned by a command through the .NET Install Tool in any session of vscode, vscode insiders, or otherwise that has a currently live, running process. This includes but is not limited to:
dotnet.acquire,dotnet.acquireStatus,dotnet.availableInstalls, anddotnet.findPath.b. Part of the PATH or DOTNET_ROOT environment variable in which VS Code is operating within.
dotnet.uninstallwill not uninstall if the install is considered to be 'in-use'. This command already rejected uninstalls that were made while thedotnet.execorresponding to that installation folder had a conflicting file handle that demonstrated it was running/in-use. This was determined by trying to open the executable withO_RDONLYpermissions orFILE_FLAG_NO_BUFFERINGon windows, and by checking forEBUSY,EACCESS, or processes vialsofon Unix.Type of breaking change
Reason for change
This speeds up the developer loop by deferring the network call and installation time away from the launch of extensions that util...
dotnet.acquireAPI for VS Code No Longer Always Downloads Latest #49127💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Internal previews