-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
can use dotnet in command but cannot be located in vscode on mac os #6631
Comments
Try closing vscode completely and then restarting it. If you updated the CLI tools while vscode was open, vscode likely did not load the updated $PATH environment variable. |
@tonyferreira i restart my pc. but /bin/sh:dotnet command not found error not solved. |
@yuzd I just tried it but I exited VS Code with Cmd-Q (or Code -> Quit VS Code from the menu bar). After restarting VS Code it actually worked. Can you try that? |
@blackdwarf ➜ ~ which dotnet i copy the dotnet file from [/usr/local/bin/dotnet] to the project folder. but when start debugger. but this was not expected. |
What is the version of the SDK you have installed? You can find this out by running Thanks, Sent from my tricorder On Mon, Jul 18, 2016 at 5:40 PM -0700, "鱼东东" <[email protected]mailto:[email protected]> wrote: @blackdwarfhttps://github.com/blackdwarf ? ~ which dotnet i copy the dotnet file from [/usr/local/bin/dotnet] to the project folder. but this was not expected. ― |
@blackdwarf Thanks for helping! |
The same issue for me with 1.0.0-preview2-003121 on Mac OSX I've installed nvm much earlier than dotnet I read this issue from the OmniSharp repository, so I tried by removing the nvm related scripts from my profile ( |
The same issue for me on Win7 dotnet --version
vscode version
|
cc @gregg-miskelly as well |
@tobyee you have a very old version of the dotnet tools. Can you please install the latest and see if it repros again? |
@leonplata But i can not use node command .do you have any idea for that? |
@blackdwarf |
This issue is still happening with the latest version of Visual Studio Code on macOS. |
@bandrei If you are only seeing this problem in VS Code (not a terminal window), the problem is likely to be that you have something configured with your shell that break's VS Code's ability to scrape environment variables. There are troubleshooting steps in microsoft/vscode#21655 that you may find useful. |
I would've thought that might be the case, however whenever I run |
ok, so the omnisharp server is starting correctly after running |
further tracked it down to
It does look like the task execution is not picking up the environemnt variables |
Ok, I have absolutely no idea what happened (it might have been my empty dev.env) file that messed up the path after omnisharp started working, however I restarted and updated VSCode and things are working now. |
@bandrei check your ~/.bash_profile and comment out items one by one. In my case, the problem was caused after I added |
I'm still having this issue on osx... I had to symlink for the task to work... |
I had the same problem ( and I fixed it by launching VS Code from a Terminal shell where dotnet is visible.
I wonder if wherever VS Code is updating |
I fixed it by changing type from process to shell in the tasks.json |
Kindly check this Grepper response, works well on Ubuntu 20.04.4 LTS also. |
As silly as it is, this worked for me. My problem was I had other VS Code windows open so closing only the one causing the issue wasn't enough - all of them needed closed. Thank you!! |
Using directly the command |
This worked for me 🤷🏽♂️ |
sorry my english is not good.so i upload a pic to show my probleam.
the point is .i update to the new .net core sdk.
i add to the PATH .and i can use
dotnet new
dotnet restore
dotnet run
in the command.
but when i open the project in vscode.
the cli tools cannot be located error happen.
Environment data
dotnet --info
output:bash-3.2$ dotnet --info
.NET Command Line Tools (1.0.0-preview3-003180)
Product Information:
Version: 1.0.0-preview3-003180
Commit SHA-1 hash: d4193cd
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64
bash-3.2$ dotnet run
Project hello (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Hello World!
Console
//Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:88 The .NET CLI tools cannot be located. .NET Core debugging will not be enabled. Make sure .NET CLI tools are installed and are on the path.e.doShow @ //Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:88
I tried above .but not solved.
use command+P.and enter >Download .Net core Debugger
likes nothing hanppen . the console also have no error message.
Append
i can use dotnet restore in command.
but when i use Command+p and enter >dotnet restore
then "/bin/sh"
The text was updated successfully, but these errors were encountered: