C
C#7mo ago
Trice

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
Trice
TriceOP7mo ago
Got this far 👍
Angius
Angius7mo ago
What "run file"? And created how?
Trice
TriceOP7mo ago
i uh
Annointed
Annointed7mo ago
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...
Trice
TriceOP7mo ago
dont understand what you are asking
Annointed
Annointed7mo ago
Watch that video at 1.5x speed
Trice
TriceOP7mo ago
thanks bro ill check it out Been going through it, but I got stuck on debugging.
Angius
Angius7mo ago
You need to open the project Not the folder
Trice
TriceOP7mo ago
Is this not the project I should press f5 on?
Angius
Angius7mo ago
Your project is in MyWebApi folder So open that folder
Trice
TriceOP7mo ago
yup
Angius
Angius7mo ago
Yeah Not the C#_Shit one Or whatever other folder there is anywhere above
Trice
TriceOP7mo ago
well myWebApi is in C#_Shit
Angius
Angius7mo ago
So?
Trice
TriceOP7mo ago
sooo how would I not open c sharp shit anyway besides the point i have myWebApi open
Angius
Angius7mo ago
Just... open VS in the folder with the project Not in any other folder Not in the root of your C:// drive
Trice
TriceOP7mo ago
im actually sorry if what im saying is complete bullshit but is this not open
Angius
Angius7mo ago
The folver above is open
Trice
TriceOP7mo ago
closed it gotcha
Angius
Angius7mo ago
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 root
Trice
TriceOP7mo ago
hmmmm I mean that makes sense to ne but I cant debug the .csproj
Angius
Angius7mo ago
?
Trice
TriceOP7mo ago
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?
Angius
Angius7mo ago
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
Trice
TriceOP7mo ago
which ones are the source files
Angius
Angius7mo ago
.cs
Trice
TriceOP7mo ago
vs code aint caring
Angius
Angius7mo ago
Do you have the proper folder open yet?
Trice
TriceOP7mo ago
yes?? MyWebApi on Visualstudio code with all my stuff in it
Angius
Angius7mo ago
That is the top-level folder you have opened? Not some /Foo/Bar/Baz/MyCoolFiles/MyWebApi?
Trice
TriceOP7mo ago
lol sorry was laughing at that thats what my workspace looks like rn
Angius
Angius7mo ago
Okay
Trice
TriceOP7mo ago
only thing open
Angius
Angius7mo ago
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
Trice
TriceOP7mo ago
dude i dont understand how Im not suppose to have anything else open but that because its in it
Angius
Angius7mo ago
Close VS Code Open file explorer Go to the folder where your .csproj is Right-click anywhere Click "Open with VS Code"
Trice
TriceOP7mo ago
alright that has been done bro im sorry I dont understand
Angius
Angius7mo ago
Which part?
Trice
TriceOP7mo ago
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
Angius
Angius7mo ago
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
Trice
TriceOP7mo ago
alright ill just make MyWebApi its own folder and take it out of c#Shit
Angius
Angius7mo ago
Or you can just open that folder...? You know that you can open just MyStuff instead of Foo/Bar/Baz/Quz/MyStuff?
Trice
TriceOP7mo ago
no i did not anyway
Angius
Angius7mo ago
"This has been done" my ass
Trice
TriceOP7mo ago
????/ THAT OPENS THE c#SHIT because thats literally its file location
Angius
Angius7mo ago
Interesting, because I found this random project here, on my PC Then I right-clicked to open with Code And it opened just that
Trice
TriceOP7mo ago
This? is that what I needed to do this whole time
Angius
Angius7mo ago
What you needed is to open the project directory
Trice
TriceOP7mo ago
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
Angius
Angius7mo ago
Alternatively, I have another solution Throw VS Code into the garbage where it belongs Download VS 2022 Use that
Trice
TriceOP7mo ago
didnt know that existed wait whats the main difference between the two
Angius
Angius7mo ago
VS Code sucks ass at doing C# VS does not VS sucks ass at any other language besides C# and maybe F#
Trice
TriceOP7mo ago
ooooo
Angius
Angius7mo ago
VS Code does not
Trice
TriceOP7mo ago
ya see I come from my humble python background' but ill download vs which one
Angius
Angius7mo ago
Community
Trice
TriceOP7mo ago
gotcha
Angius
Angius7mo ago
It's the free one
Trice
TriceOP7mo ago
alright its downloading Now ima do my best to try and get c# to work on this before asking you monkey brain questions
Angius
Angius7mo ago
With VS installed there isn't much getting it to work You open VS, make a new project, there Done, works
Trice
TriceOP7mo ago
just a single file?
Angius
Angius7mo ago
No, not a single file
Trice
TriceOP7mo ago
aw hey but if it works how do I install c# on VS? cant find it in the extensions
Angius
Angius7mo ago
No need to install any extensions Just make sure you have the ASP workload installed Seeing how you want to make an API
Trice
TriceOP7mo ago
Actually dont know shit about API's
Angius
Angius7mo ago
It should've prompted you during installation, but if not, just run VS installer
Trice
TriceOP7mo ago
just following along with a tutorial about making a project and it didnt go well
Angius
Angius7mo ago
Then select "modify" next to your version of VS And give the ASP worload a checkmark
Trice
TriceOP7mo ago
alright what would I click then if I just want to make something to run something to output text on the modify page
Angius
Angius7mo ago
Classic apps for .NET platform, or something like that It covers WPF, Winforms, and console apps
Trice
TriceOP7mo ago
so i wouldnt need ASP?
Angius
Angius7mo ago
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
Trice
TriceOP7mo ago
dat?
Angius
Angius7mo ago
Yeah
Trice
TriceOP7mo ago
alr cool waiting for theses packages to download bam look at me go
Angius
Angius7mo ago
Nice
Trice
TriceOP7mo ago
now I press ctrl + F5 to debug but I dont get a hello world output on the terminal
Angius
Angius7mo ago
Add Console.ReadLine() right after see if that works
Trice
TriceOP7mo ago
oh wait nah i just didnt see it Sucess time to write master code now off to make millions
Angius
Angius7mo ago
Good luck lol
Trice
TriceOP7mo ago
thanks like honestly
Want results from more Discord servers?
Add your server