-
Notifications
You must be signed in to change notification settings - Fork 14
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] Cannot correctly locate dotnet (Linux) #637
Comments
@uldahlalex Can you provide the following additional information:
Thank you! |
Sure! Runtime Environment: .NET workloads installed: Host: .NET SDKs installed: .NET runtimes installed: Other architectures found: Environment variables: global.json file: Learn more: Download .NET:
|
@uldahlalex For number 2, I was referring to this window rather than the Solution Explorer: |
@tmeschter My apologies! Here is the output: [Error - 20:05:17] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server. |
@uldahlalex Is that from the "Projects" output, or the "C#" output? The "Projects" output would be the useful one. |
@tmeschter The output of the C# Dev Kit option in the dropdown is: Starting Spawn .NET server... |
@uldahlalex Ah, ok. Knowing that we didn't even get far enough to create the Projects output pane is helpful. Thank you! |
@lifengl Are you aware of any issues locating the SDK on Linux? |
Same issue for me. Note that I have multiple SDKs installed. Tried with a single SDK also doesn't work. |
I am having this problem on MacOS as well. It is very annoying. At the very least - could you give us an option to explicitly tell it where dotnet is! |
Here is a workaround I found. I have tested this in Ubuntu 22.04 Essentially what happens is that, the solution explorer in VS Code works fine because it finds the It took me a couple of hours to find this workaround. Their should be an explicit way to tell C# DevKit which installation of .NET to use. |
This issue has been marked as stale after 14 days of inactivity. @[ @ @], could you please take a look? |
It says so much about MS that issues are deleted because of inactivity rather than escalated because of inactivity! |
I'm experiencing the same bug as this. I couldn't replicate it exactly in a repo, but got a similar issue with this: I have installed the SDK manually in my home folder In my settings.json for vscode: ...
"omnisharp.dotNetCliPaths": [
"/home/agupta5/.dotnet/dotnet"
],
"dotnet.dotnetPath": "/home/agupta5/.dotnet",
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.csdevkit",
"path": "/home/agupta5/.dotnet/dotnet"
},
{
"extensionId": "ms-dotnettools.csharp",
"path": "/home/agupta5/.dotnet/dotnet"
},
{
"extensionId": "ms-dotnettools.vscode-dotnet-runtime",
"path": "/home/agupta5/.dotnet/dotnet"
},
{
"extensionId": "ms-dotnettools.vscodeintellicode-csharp",
"path": "/home/agupta5/.dotnet/dotnet"
}
],
... The extension runs fine, but the solution explorer says The SDK was installed via this guide: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual
and the is not dotnet installed on the machine in the default location. I encountered this error via
If I then install the sdk in the default location: |
@lifengl May you take a look at @tmeschter's question above? Thank you @LiveGood for providing a workaround. There is actually a setting you can use to tell it which runtime to use, which the other individual points to above. The PATH setting is what takes precedence over this, so if you can set the PATH, that .NET Install will be used. |
Edit: My previous comments were wrong. The only fix for this on my computers has been to open my editor from the command line. |
I figured that if someone installed dotnet using apt then using dotnet-install.sh, dotnet prioritizes the one installed from apt. Typing I tried just purging the dotnet installation from apt by doing export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools After that I typed |
Describe the Issue
When i run whereis dotnet, i get the expected output path:
/home/alex/dotnet/dotnet
However, C# Dev Kit reports the following:
No installed .NET SDK was found on the computer. If it is installed, make sure it can be found through the PATH environment variable. C# Dev Kit does not work without a supported version of SDK. After installing the SDK, you need restart the VS Code session, or the computer.
Furhtermore, the CodeAnalysis.LanguageServer attempts to search in the wrong directory, and there does not seem to be a way to guide it to the right one: Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Cannot find dotnet path '/home/alex/dotnet/dotnet/dotnet'
Steps To Reproduce
Expected Behavior
I expected the SDK to be available. Running dotnet --info in the vscode terminal works fine.
Environment Information
Arch Linux
Vscode 1.83.1
C# Dev Kit 1.0.4
The text was updated successfully, but these errors were encountered: