core icon indicating copy to clipboard operation
core copied to clipboard

The term 'dotnet' is not recognized...

Open soleshhaker opened this issue 2 years ago • 8 comments

Description

Hi In Visual Studio Code I get error saying: "dotnet : The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again." obraz

It works fine in cmd obraz

Here's my dotnet folder obraz

Even got sdk .net 6 obraz And here's my PATH obraz Also for user obraz

Configuration

I'm running Win10 64x [Version 10.0.19045.3086]

Other information

I tried repairing redistributables, reinstalling visual studio code, reinstalling .net sdk, uninstalling visual studio 2022, restarting PC each time, running as administrator, opening new terminals each time. Using custom path in C# extensions also didn't work. I'm running out of ideas, any way to fix this?

soleshhaker avatar Jun 20 '23 13:06 soleshhaker

And did you restart VS Code after installing it?

mairaw avatar Jun 20 '23 17:06 mairaw

Also adding @timheuer for ideas here

mairaw avatar Jun 20 '23 17:06 mairaw

reinstalling .net sdk

How are you installing the SDK @soleshhaker? /cc @baronfel

timheuer avatar Jun 20 '23 18:06 timheuer

PATH looks good from those screenshots, but dotnet --info from both the terminal as well as VSCode's built-in terminal would be useful info to have.

baronfel avatar Jun 20 '23 18:06 baronfel

And did you restart VS Code after installing it?

Yes I should have stated that when using new terminal, I meant that after restarting VS Code I additionally close old terminal and start a new one, so yes I did restart it each time.

How are you installing the SDK @soleshhaker? /cc @baronfel

I uninstall the old one in "add or remove programs", then I just install what I downloaded from https://dotnet.microsoft.com/en-us/download specifically I Use this button to download obraz I get file named dotnet-sdk-7.0.304-win-x64 and proceed with installing it as any other program.

PATH looks good from those screenshots, but dotnet --info from both the terminal as well as VSCode's built-in terminal would be useful info to have.

obraz

soleshhaker avatar Jun 21 '23 08:06 soleshhaker

Decided to update, I get the same(very similar) error in visual studio 2022

soleshhaker avatar Jun 22 '23 15:06 soleshhaker

This issue is stale because there has been no response to a request for more information for 7 days.

github-actions[bot] avatar Jun 29 '23 15:06 github-actions[bot]

any chance of help with this? I'm using system cmd and it works fine, but it's kinda annoying

soleshhaker avatar Jul 04 '23 09:07 soleshhaker

What I see from the info is that it says "Environment variables: Not set" even though I was convinced I had set them. I guess there's a syntax that nobody told me about.

Seeing as how I would also like a resolution to this issue, I'm hoping someone knows what's going on. image image

MajesticalDiscomfort avatar Sep 01 '23 23:09 MajesticalDiscomfort

Not sure what causes this but this thread offers a workaround: https://stackoverflow.com/questions/69921890/dotnet-works-from-windows-10-command-prompt-but-not-in-vscode

mairaw avatar Sep 02 '23 05:09 mairaw

And did you restart VS Code after installing it?

Hahaha this worked for me. Thanks :)

ierdss avatar Feb 29 '24 14:02 ierdss