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