-
Notifications
You must be signed in to change notification settings - Fork 16
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
[BUG] Failed to find dotnet from path with "which dotnet" #1565
Comments
Thank you @dibarbet The solution I have tried from https://stackoverflow.com/a/79131320/2402577:
But I am still having the same error. Looks like |
@nagilson would you first scout? Also, is this something we will have covered in the PATH api switch? |
The PATH API considers both bin/sh and bin/bash. Although it's not supporting SDK lookup initially, if we added it based on our current plans post our recent conversation on Friday, I would expect it to work here. |
Sometimes vscode does not load the environment properly, but that may be based on the users settings. If the user sets the PATH in both bin/bash and bin/sh, then launching vscode through the terminal, Im curious to see if it works? Im also curious if it works if they set DOTNET_ROOT. |
@nagilson I confirm that PATH in /bin/bash is set. /bin/sh reads from .profile I assume, that is set as well. Like /bin/sh in terminal see my PATH where /bin/sh in vscode does not. |
Maybe dumb question - have you fully restarted VSCode? Not just closing the window but in the top left bar quit the entire application? IIRC there was an issue on Mac where changes to PATH or other environment variables wouldn't be seen until VSCode was quite entirely. |
@dibarbet Yes sir I have restarted the VSCode, restarted to computer as well. /bin/sh in vscode only sees I was not able to figure out how can I update its PATH (seems like its the only solution) or somehow force vscode to use /bin/bash. |
@avatar-lavventura Thank you for responding to us.
And share the result of the PATH from that output (denote privacy) |
I am getting following error:
|
For both command I get following for
|
Thank you. That's the code that our new API does use to scan the PATH, so this increases my confidence that the change we are working on would fix this scenario. And interesting to see that node is working fine here. If it doesn't get fixed by our change then honestly I (us at MSFT) would take this to vscode and talk to them to see why is invoking this code in their context not getting the same result |
Thank you sir. When would be the change will take the place? How can I update it? |
Some parts still need to be implemented. Youd get the update automatically as long as you havent disabled automatic extension updates. But I imagine it will still be a few weeks out. In the meantime, I would try setting DOTNET_ROOT in your terminal and launching vscode from there to see if it helps. Otherwise, the OP would be the one who could provide a workaround. |
@nagilson any update on this? Should this be moved forward another milestone as we wait for all the parts to use the new API? |
For C# it's in prerelease and for DevKit it's in a PR thats about to be merged. Any work on my teams end is pretty much complete besides maybe caching. It wont be turned on by default for DevKit though. I would move it forward if you'd like to make a new thing to track turning it on by default. |
The latest pre-release version of C# Dev Kit extension (1.16.4) has a new implementation for locating dotnet which should fix this. To do that, you need to uncheck this setting located under Extensions -> C# -> C# Dev Kit: Dotnet: Use Legacy Dotnet Resolution. |
Describe the Issue
Originally filed by @avatar-lavventura at dotnet/vscode-csharp#7701
I have installed dotnet sdk inside MacBook and in my terminal
dotnet --info
returns valid information.But inside
Visual Studio Code
, I am getting following error message, when I try to run the project:How can I fix this error? Note that vscode tries to read
PATH
from/bin/sh
rather than/bin/bash
.Steps To Reproduce
No response
Expected Behavior
No response
Environment Information
No response
The text was updated successfully, but these errors were encountered: