C
C#2y ago
Hazzza

❔ 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
Hazzza
HazzzaOP2y ago
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
Kouhai
Kouhai2y ago
Can you open a terminal and run dotnet --list-sdks
Hazzza
HazzzaOP2y ago
Ok is that the windows terminal or VS terminal?
Kouhai
Kouhai2y ago
windows terminal
Hazzza
HazzzaOP2y ago
Ok
Hazzza
HazzzaOP2y ago
I think i've done this wrong
Hazzza
HazzzaOP2y ago
but I got this output I ran as administrator and normal
Kouhai
Kouhai2y ago
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.
Hazzza
HazzzaOP2y ago
Ok thanks, downloading now I'll let you know how it goes I think this is a different issue, it now finds the .NET
Hazzza
HazzzaOP2y ago
Hazzza
HazzzaOP2y ago
but it says this idk what is failing to load this is the whole output
Kouhai
Kouhai2y ago
Are you using the C# Devkit extension?
Hazzza
HazzzaOP2y ago
yeah
Kouhai
Kouhai2y ago
Does following these instructions still show "1 failed to load" output?
Hazzza
HazzzaOP2y ago
still shows the same failed to load but i think its because my VS is messed up
Kouhai
Kouhai2y ago
Hmmm, have you tried restarting your machine?
Hazzza
HazzzaOP2y ago
when i attempt to debug my code it shows this error from an old project
Hazzza
HazzzaOP2y ago
yes restarting didn't change anything though
Kouhai
Kouhai2y ago
The project uses the old style csproj format, I don't think C# devkit supports it
Hazzza
HazzzaOP2y ago
how to i delete the project since i don't need it anymore delete the file?
Kouhai
Kouhai2y ago
Yes, or simply create a new project
Hazzza
HazzzaOP2y ago
Ok how do i create a new project since i only know how to create new files
Jimmacle
Jimmacle2y ago
dotnet new console for a console app
Anchy
Anchy2y ago
or just dotnet new for a list of common templates you can use dotnet new list for all templates
Accord
Accord2y ago
Was 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.

Did you find this page helpful?