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