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] Error running dotnet --info: Error: Command failed: dotnet --info /bin/sh: dotnet: command not found /bin/sh: dotnet: command not found #1192

Closed
GitHanDong opened this issue Jun 12, 2024 · 7 comments
Labels
area-dotnet-acquisition area-sdk bug Something isn't working high-priority needs-more-info Needing more information, waiting on OP

Comments

@GitHanDong
Copy link

Describe the Issue

找不到 .NET Core SDK 的位置:Error running dotnet --info: Error: Command failed: dotnet --info /bin/sh: dotnet: command not found /bin/sh: dotnet: command not found 。将不会启用 .NET Core 调试。请确保已安装 .NET Core SDK 且该 SDK 位于路径上。

image image

Steps To Reproduce

Visual Studio Code

版本: 1.90.0 (Universal)
提交: 89de5a8d4d6205e5b11647eb6a74844ca23d2573
日期: 2024-06-04T19:34:44.157Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0

macOS Sonoma 14.5

CPU: M2

Expected Behavior

No response

Environment Information

No response

@nagilson
Copy link
Member

Thank you for your report. Have you tried to install the .NET SDK via the Walkthrough / Getting Started Page?

@nagilson nagilson added the needs-more-info Needing more information, waiting on OP label Jul 16, 2024
@GitHanDong
Copy link
Author

Thank you for your report. Have you tried to install the .NET SDK via the Walkthrough / Getting Started Page?

Yes I tried reinstalling the SDK and tried installing a different version. As you can see below I installed three versions. And I guess it might be that vscode's default console does not match my local console configuration, try to set vscode's console to match my local one (ZSH). But that didn't solve the problem either.
image

@github-actions github-actions bot removed the needs-more-info Needing more information, waiting on OP label Jul 17, 2024
Copy link

@nagilson, the 'needs-more-info' label has been removed upon receiving further response from the original bug filer.

@nagilson
Copy link
Member

Thank you for following up. This is most likely a PATH issue. If you try to print the PATH environment variable in Vs Code, what do you get, and is it different from your terminal? I would suspect if you can add the .NET to the PATH in VS Code, it would work.

We do edit the PATH in 3 different ways so I'm surprised it's not working for you, this is unfortunate. If you mind sharing some logs, then that could be helpful.

Our log files are located alongside VS Code logs. If you want to find them manually, navigate here:
Linux: ~/.config/Code/logs
Mac: ~/Library/Application Support/Code/logs/
Windows: c:\Users\USER\AppData\Roaming\Code\logs\

Then find the folder created at the time you experienced the bug in the logs folder.
From there, go to window1 -> exthost -> ms-dotnettools.vscode-dotnet-runtime. The log file should be located in this folder.

Note: The window folder may change depending on how many VS Code windows you have open; if our extension is running in the 2nd window, it'd be in a folder called window2.

@nagilson nagilson added the needs-more-info Needing more information, waiting on OP label Jul 17, 2024
@linv2
Copy link

linv2 commented Jul 20, 2024

I'm using code-server having this problem too, and the same thing is that I'm using the arm architecture too!

code-server
code-server: v4.91.1
Code: 1.91.1
Commit: 1962f48b7f71772dc2c060dbaa5a6b4c0792a549
Date: 2024-07-15T17:58:33.007Z (4 days ago)
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0

ubuntu@instance-20240508-1435:/home/ubuntu$ echo $PATH
/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/home/ubuntu/.dotnet


ubuntu@instance-20240508-1435:/$ dotnet --info
.NET SDK:
 Version:           8.0.303
 Commit:            29ab8e3268
 Workload version:  8.0.300-manifests.c915c39d
 MSBuild version:   17.10.4+10fbfbf2e

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  20.04
 OS Platform: Linux
 RID:         linux-arm64
 Base Path:   /home/ubuntu/.dotnet/sdk/8.0.303/

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.7
  Architecture: arm64
  Commit:       2aade6beb0

.NET SDKs installed:
  8.0.303 [/home/ubuntu/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.7 [/home/ubuntu/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.7 [/home/ubuntu/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download```

@linv2
Copy link

linv2 commented Jul 20, 2024

when i exec

sudo ln -s /home/ubuntu/.dotnet/dotnet /usr/local/bin/

the extension looks working.

@nagilson
Copy link
Member

For @linv2 issue, this is an issue with snap installs that is being tracked by canonical and they are working on fixing it. canonical/dotnet-snap#13 (comment)

For the above issue, if you are still facing it, please follow up with the requested information so we can help you. This is a separate issue from linv2's issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dotnet-acquisition area-sdk bug Something isn't working high-priority needs-more-info Needing more information, waiting on OP
Projects
None yet
Development

No branches or pull requests

4 participants