-
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] .NET not found in PATH, but exists in my computer even I install the .NET SDK and set the PATH variable in VSCode #1621
Comments
I use |
C# Dev Kit logs:
|
I found the .NET runtime version in VSCode log: |
Still not working when I set |
Even when I create the profile in VSCode, the linting and auto code completion features still doesn't work. |
@nagilson would you please scout this one and reroute? |
The .NET runtime thats resolved as 8.0 is for the C# extension to run its code under, so it doesnt need to be 9.0. That extension is written in 8.0 right now. The problem is that the SDK is not being found correctly likely by C# DevKit. We wrote an API to find the SDK better for DevKit, which @adrianvmsft is working on using which should fix this issue. @lulunac27a For a workaround for now -- can you try to -- launch vscode from the terminal? If you launch from the dock in mac sometimes vscode doesn't get the environment correctly. You can also try to set DOTNET_ROOT to your dotnet executable path and then launch from the terminal and see if it works. |
The linting and autocompletion suggestions are still not working when I set |
Thank you, that sounds like a bug with those areas, then. @lifengl May you please see why the linting and autocomplete is not working here? Or do you know a contact who works on the project system that would understand this better (@tmeschter?) @arunchndr, if you also have a project system contact that'd be helpful. Sorry it is not working for you. As an alternative temporary solution (not sure if this will work), you might be able to install the SDK in a different way (mac installer on the website, via vscode walkthrough ui, homebrew, etc) but I doubt that's it. |
I too faced same issue in MAC, In my case already i had PATH variable setup done for dotnet using .zshrc file. However for some reason when we open VS directly, it uses some other terminal and taking wrong path like /usr/bin etc. |
@nagilson / @JakeRadMSFT any update on this one? Does it need to be moved to the next milestone? Will switching to use the new API fix this? |
Please see #1565 (comment) |
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
When I installed the latest version of .NET SDK, VSCode shows that .NET SDK is not installed, but .NET SDK was already installed and the executable is already in the PATH environment variable.
Steps To Reproduce
Expected Behavior
Successfully lint and show autocompletion features without showing an error message.
Environment Information
The text was updated successfully, but these errors were encountered: