✅ VSCode error
When I type in the code "dotnet new console" it just gives me a error message when its supposed to create files in my folder that I selected. If your wondering yes I have the framework and sdk's installed
42 Replies
you can check that you don't have any SDK with
dotnet --list-sdks
it doesn't list anything
yup, so install an sdk
then whats all those "sdks" i installed
<:PES2_Shrug:513352546341879808>
oh
have you restarted vscode?
?
after installing the sdks, you might need to restart vscode because of environment variable stuff
if that won't let you use dotnet new, maybe a computer restart is needed
this may sound like a stupid question but how do you restart vsc
close it and open it again
yeah did that still gives me the error message in the corner
hold on ima restart
still got the error in the terminal
what does
set path
output in the terminal?
also check if dotnet --list-sdks
is still emptynothing
where calc
?change this to the normal command prompt
I cba to google how to see environment variables in powershell
then try
set path
and dotnet --list-sdksC:\Users\taiya>set path
Path=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Git LFS;C:\Program Files (x86)\dotnet;C:\Program Files\dotnet;C:\Users\taiya\AppData\Local\Microsoft\WindowsApps;C:\Users\taiya.dotnet\tools;C:\Users\taiya\AppData\Local\Programs\Microsoft VS Code\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
still nothing
so yeah pretty stuck
Can you open the installed programs in control panel
sure just gimme 20 mins i gotta do something
C:\Program Files (x86)\dotnet;C:\Program Files\dotnet
you can't have both 32bit and 64bit versions in the path, but for some reason this keeps happening to peoplethat's exactly right
setx /M PATH "%PATH:C:\Program Files (x86)\dotnet;=%"
might just work
(requires admin)this can also be done manually https://www.alphr.com/set-environment-variables-windows-11/
you need to edit
Path
, remove C:\Program Files (x86)\dotnet
from it, click OK everywhere to save, you'll need to reopen vscode and dotnet --list-sdks
should list the SDKs finallyAlphr
How To Set Environment Variables in
Windows uses environment variables to store information about a system, such as its processes and resource usage. Setting these variables means creating shortcuts that allow you to find data locations using a keyword instead of typing in the whole location
just uninstall the x86 versions
^if the 5 SDKs you shown on the screenshot are not the only ones you have
alr im back
thing is i only download the 64bit version of the sdks
the 32b path precedes the 64b one so
dotnet
is found in the 32b folder, executed and it finds no 32b SDKs, that's why you can't do anythingso whats the solution exactly the one your just explained or the one im replying to
that
and requires admin?
yes
wdym by admin like how would i access command prompt
with admin
Win+S, "cmd", "Run as administrator"
oh like that
nvm i thought you meant in another way
this path?
never mind found it
les go
nice
oh bruh i thought i had to change it