The term 'dotnet' is not recognized...
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."
It works fine in cmd
Here's my dotnet folder
Even got sdk .net 6
And here's my PATH
Also for user
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?
And did you restart VS Code after installing it?
Also adding @timheuer for ideas here
reinstalling .net sdk
How are you installing the SDK @soleshhaker? /cc @baronfel
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.
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
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 --infofrom both the terminal as well as VSCode's built-in terminal would be useful info to have.
Decided to update, I get the same(very similar) error in visual studio 2022
This issue is stale because there has been no response to a request for more information for 7 days.
any chance of help with this? I'm using system cmd and it works fine, but it's kinda annoying
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.
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
And did you restart VS Code after installing it?
Hahaha this worked for me. Thanks :)