❔ New to C#: Cant press F5 to debug in Visual Studio Code
I'm trying to debug C# using F5 but it doesnt respond
69 Replies
Any help is appreciated
Hmm, your c# class file is called prgram ? not program ?
Can i see the file structure of the project or solution?
Also, did you add Visual studio code extensions ? Like C# and C# Dev Kit ?
ah yes I did I installed and reinstalled it
I'll show you my files

The problem is probably that you have more than one Main method
ohhh
You need to only have one main method, its the entry point of the application
If you want to have more methods, you can make more methods named other than Main, and you can make more classes other than Program
I am fairly new to this

So I am supposed to fix this file?

This is myn other file, I am fairly new to the concept of a Main method. Could I kindly ask you assistance in a solution for this?
Thanks for your time : )
No worries, i will help you the best i can
I am curious because i see your programMethod class but usually there is already a Program class created when you create a new project. Did you delete or rename this "Program" class file ?
Ohh maybe it is because of this file that I downloaded

it is the source code for the lessons I am learning
I am learning intermediate C# : ") prob a bad idea bc I only am skilled in Ruby

I am a bit confused because you show me file structures ok but it doesnt seem to be the same as the files i see in your first VSCode screenshot
With "Learn" and COS20007
Oh those are 2 different files
I am sorry


So, when you are in this folder "learn", you open with VSCode, right ?
OH it was bc of the test file
yes!
Is there a Main also in the test files ?
yes there was
I deleted it and there is no error now
however, I cant use ctrl + F5
I've tried to google search but nothing comes up? I know this is super common but I've been struck for a day now
your "learn" folder, you downloaded it like it is from your teacher or something like that, right ?
yes it is
ah let me convert this into video format
What is the error that you get now? still about entry point?
There is no9 error
They gave me a selection
you probably need to update the launch.json file that's opened up
of .NET to use, I chose .NET

Ohhh

should start off like that

if you press ctrl + space while your cursor is inbetween the [], it will give you options
got it!

hmm should be a list of suggestions like this:

wait nvm earlier I accidently typed '2'

so which should I select?
It's just a Console app you're working on at the moment?
yep
I just want to see it debug
should just be that one then

change this line too:



fingers crossed should work now




Does this count as debugging?
And the "Problems" tab ?

I saw the instructor has a "watch" window open, does that come w vs code?
I think this is beyond my knowledge of visual studio code 😅
But maybe you could try to specify the Path to your program file ? in the launch.json
This seems to indicate that for some reason, the path is not valid
hmm but usually this is how debugging looks like w C# rigght?

I've rarely used debug bc I've only learned Ruby
Oh yes, seems like it ran
try some breakpoints and see if it stops there
Idk, if you want to learn C# as beginner i think you could consider installing Visual studio 2022 community
VSCode is not so beginner friendly atm. Its better than before, but not as good as Visual studio, speaking of first experience

yeah I think so too
ok the breakpoiint worked! thanks : D
yeah it's nice and lightweight, but doesn't give you a lot of the features/guidance Visual Studio does
Very nice!
thank you again SinFluxx and 

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.