Skip to content
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

Open
lulunac27a opened this issue Nov 19, 2024 · 8 comments
Assignees
Labels
area-sdk bug Something isn't working high-priority mac MacOS
Milestone

Comments

@lulunac27a
Copy link

lulunac27a commented Nov 19, 2024

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

  1. Install the latest version of .NET SDK.
  2. Add the path of .NET SDK executable in PATH variable.
  3. Open VSCode and reload windows.
  4. See the error message on buttom right of the window.

Expected Behavior

Successfully lint and show autocompletion features without showing an error message.

Environment Information

  • OS: macOS 15.0
  • VSCode Version: v1.95.2
  • Extension Version: C# Dev Kit v1.13.9
@lulunac27a lulunac27a added the bug Something isn't working label Nov 19, 2024
@lulunac27a
Copy link
Author

I use code . command and C# language server initialized successfully, but linting and autocompletion were not loaded successfully.

@lulunac27a
Copy link
Author

C# Dev Kit logs:

Failed to listen to project initialization status: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.ProjectInitializationStatusService (0.1)" service failed.
Failed to subscribe to active projects: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryExecutionService (0.3)" service failed.

@lulunac27a
Copy link
Author

I found the .NET runtime version in VSCode log: Using local .NET runtime at "/Users/lulu/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.11~arm64~aspnetcore/dotnet". How can I update the runtime version to the latest version (v9.0) so VSCode matches that version because I already installed the latest version of .NET in my computer?

@lulunac27a
Copy link
Author

Still not working when I set omnisharp.sdkPath (Omnisharp: Sdk Path) to installed executable of /usr/local/share/dotnet, /usr/local/share/dotnet/dotnet or /opt/homebrew/bin/dotnet.

@lulunac27a
Copy link
Author

Even when I create the profile in VSCode, the linting and auto code completion features still doesn't work.

@arunchndr
Copy link
Member

@nagilson would you please scout this one and reroute?

@arunchndr arunchndr added this to the Dec2024 milestone Nov 26, 2024
@nagilson
Copy link
Member

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.

@lulunac27a
Copy link
Author

lulunac27a commented Nov 27, 2024

The linting and autocompletion suggestions are still not working when I set DOTNET_ROOT to /usr/local/share/dotnet and the same when I open VSCode from the terminal using code .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-sdk bug Something isn't working high-priority mac MacOS
Projects
None yet
Development

No branches or pull requests

4 participants