-
Notifications
You must be signed in to change notification settings - Fork 384
Check dotnet path without which or where first #2234
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
Check dotnet path without which or where first #2234
Conversation
Which and where can be slow to find. For the common case which we want to make fast, we can just check 'dotnet' first and see if that works. Note: Ideally, this function would only return a string, but that would require writing a wrapper around this return type just for this function and does not follow the other existing patterns. With respect to tests: This should be covered by the existing 'find path' tests.
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 reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
vscode-dotnet-runtime-library/src/Acquisition/DotnetPathFinder.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
| { | ||
| const oldLookup = process.env.DOTNET_MULTILEVEL_LOOKUP; | ||
| try { | ||
| process.env.DOTNET_MULTILEVEL_LOOKUP = '0'; // make it so --list-runtimes only finds the runtimes on that path: https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/7.0/multilevel-lookup#reason-for-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.
Not enabling this will prevent discovery of dotnet subdirectories:
When running the application through [dotnet](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet), subdirectories relative to the dotnet executable.
https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/7.0/multilevel-lookup
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Which and where can be slow to find. For the common case which we want to make fast, we can just check 'dotnet' first and see if that works.
Note: Ideally, this function would only return a string, but that would require writing a wrapper around this return type just for this function and does not follow the other existing patterns.
With respect to tests: This should be covered by the existing 'find path' tests.
cc @lifengl