❔ I can't run my C# code in VS code
I get the message
'The .NET Core SDK cannot be located. A valid dotnet installation could not be found. .NET Core debugging will not be enabled. Make sure .NET Core SDK is installed and is on the path
26 Replies
I'm pretty sure I downloaded the file VS told me to get but still doesn't work, maybe the path is wrong but i'm not sure how to change that
Can you open a terminal and run
dotnet --list-sdks
Ok
is that the windows terminal or VS terminal?
windows terminal
Ok
I think i've done this wrong
but I got this output
I ran as administrator and normal
Alright you need to install .NET SDK!
https://dotnet.microsoft.com/en-us/download
Microsoft
Download .NET (Linux, macOS, and Windows)
Free downloads for building and running .NET apps on Linux, macOS, and Windows. Runtimes, SDKs, and developer packs for .NET Framework, .NET, and ASP.NET.
Ok thanks, downloading now
I'll let you know how it goes
I think this is a different issue, it now finds the .NET
but it says this
idk what is failing to load this is the whole output
Are you using the C# Devkit extension?
yeah
Get started with C# and .NET in Visual Studio Code
Getting Started with C# and .NET Development in Visual Studio Code
Does following these instructions still show "1 failed to load" output?
still shows the same failed to load
but i think its because my VS is messed up
Hmmm, have you tried restarting your machine?
when i attempt to debug my code it shows this error from an old project
yes
restarting didn't change anything though
The project uses the old style csproj format, I don't think C# devkit supports it
how to i delete the project since i don't need it anymore
delete the file?
Yes, or simply create a new project
Ok
how do i create a new project since i only know how to create new files
dotnet new console
for a console appor just
dotnet new
for a list of common templates
you can use dotnet new list
for all templatesWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.