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