sdk: can use dotnet in command but cannot be located in vscode on mac os

image

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: d4193cd5c1

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

image i can use dotnet restore in command. but when i use Command+p and enter >dotnet restore then “/bin/sh”

image

image

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 26 (2 by maintainers)

Most upvoted 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.

@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?

I’m still having this issue on osx…

I had to symlink for the task to work… ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/

@bandrei check your ~/.bash_profile and comment out items one by one. In my case, the problem was caused after I added export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

This issue is still happening with the latest version of Visual Studio Code on macOS.

@blackdwarf ➜ ~ which dotnet /usr/local/bin/dotnet ➜ ~ dotnet --version 1.0.0-preview3-003180

Thanks for helping!