Need Help Setting Up C# on VsCode
idk wtf im doing, online tutorials don't really help. I can't run the file I created.
81 Replies
Got this far 👍
What "run file"?
And created how?
i uh
Julio Casal
YouTube
VS Code Tutorial For C# Developers
💻Get the source code: https://go.dotnetacademy.io/vscodetutorial
A step-by-step tutorial on how to get started building C# applications with Visual Studio Code, the lightweight but powerful source code editor that everybody is using today and that now also features impressive AI capabilities thanks to GitHub Copilot.
🔥Become a Senior C# Backen...
dont understand what you are asking
Watch that video at 1.5x speed
thanks bro ill check it out
Been going through it, but I got stuck on debugging.
You need to open the project
Not the folder
Is this not the project I should press f5 on?
Your project is in
MyWebApi
folder
So open that folderyup
Yeah
Not the
C#_Shit
one
Or whatever other folder there is anywhere abovewell myWebApi is in C#_Shit
So?
sooo
how would I not open c sharp shit
anyway besides the point
i have myWebApi open
Just... open VS in the folder with the project
Not in any other folder
Not in the root of your
C://
driveim actually sorry if what im saying is complete bullshit
but is this not open
The folver above is open
closed it gotcha
VS is looking for a
.csproj
file directly in the folder you have opened
It doesn't search for it recursively
You can maybe manually point it to a given .csproj
or .sln
file, idk
But by default, it only searches in the roothmmmm
I mean that makes sense to ne
but I cant debug the .csproj
?
so im trying to open the .cs and debug in the MyWebApi folder
but it just says that it isnt loaded
should I get that then?
The project isn't loaded because the project file is not in the top-level
And you don't debug the project file
Set your breakpoints or whatever in the source files
Then run the debugger
which ones are the source files
.cs
vs code aint caring
Do you have the proper folder open yet?
yes??
MyWebApi
on Visualstudio code
with all my stuff in it
That is the top-level folder you have opened?
Not some
/Foo/Bar/Baz/MyCoolFiles/MyWebApi
?lol
sorry was laughing at that
thats what my workspace looks like rn
Okay
only thing open
So
I'll come back once you listen to the very first thing I told you to do
Until then I'll be chekcing out
dude i dont understand how Im not suppose to have anything else open but that
because its in it
Close VS Code
Open file explorer
Go to the folder where your
.csproj
is
Right-click anywhere
Click "Open with VS Code"alright
that has been done
bro im sorry I dont understand
Which part?
the fact that like you want me to close the top folders
but my project is in those folders
like c#_shit, but Its just where I have the project
I told you
But I can repeat
VS Code looks for the project file in the TOP LEVEL and TOP LEVEL only
If it cannot find anything there, it takes a shit on the floor and dies
alright ill just make MyWebApi its own folder and take it out of c#Shit
Or you can just open that folder...?
You know that you can open just
MyStuff
instead of Foo/Bar/Baz/Quz/MyStuff
?no
i did not
anyway
"This has been done" my ass
????/
THAT OPENS THE c#SHIT
because thats literally its file location
Interesting, because I found this random project here, on my PC
Then I right-clicked to open with Code
And it opened just that
This?
is that what I needed to do this whole time
What you needed is to open the project directory
see now that makes sense
I mean ima have to look up to do that
but those words sounds like they can fix the problem
Alternatively, I have another solution
Throw VS Code into the garbage where it belongs
Download VS 2022
Use that
didnt know that existed
wait whats the main difference between the two
VS Code sucks ass at doing C#
VS does not
VS sucks ass at any other language besides C# and maybe F#
ooooo
VS Code does not
ya see I come from my humble python background'
but ill download vs
which one
Community
gotcha
It's the free one
alright its downloading
Now ima do my best to try and get c# to work on this before asking you monkey brain questions
With VS installed there isn't much getting it to work
You open VS, make a new project, there
Done, works
just a single file?
No, not a single file
aw
hey but if it works
how do I install c# on VS?
cant find it in the extensions
No need to install any extensions
Just make sure you have the ASP workload installed
Seeing how you want to make an API
Actually dont know shit about API's
It should've prompted you during installation, but if not, just run VS installer
just following along with a tutorial about making a project and it didnt go well
Then select "modify" next to your version of VS
And give the ASP worload a checkmark
alright what would I click then if I just want to make something to run something to output text
on the modify page
Classic apps for .NET platform, or something like that
It covers WPF, Winforms, and console apps
so i wouldnt need ASP?
No need
ASP.NET Core is a web framework
If you're not doing anything web, you don't need support for it in your IDE
dat?
Yeah
alr cool
waiting for theses packages to download
bam look at me go
Nice
now I press ctrl + F5 to debug but I dont get a hello world output on the terminal
Add
Console.ReadLine()
right after see if that worksoh wait nah i just didnt see it
Sucess
time to write master code now
off to make millions
Good luck lol
thanks
like honestly