C
C#2y ago
shuffle

unable to call main method

Hi my program stops one line before the main method causing it to not run any help would be appreciated
No description
39 Replies
Angius
Angius2y ago
Program cannot stope before Main() because Main() is the entry point of the program It's quite literally the very first thing that gets executed
shuffle
shuffleOP2y ago
Why does nothing happen then
shuffle
shuffleOP2y ago
No description
Angius
Angius2y ago
It seems you're in the debugger
dhoni7
dhoni72y ago
you should step over using the debugger
Angius
Angius2y ago
Did you intend to run the debugger?
shuffle
shuffleOP2y ago
I wanted to run the program
Angius
Angius2y ago
Well, you ran the debugger
shuffle
shuffleOP2y ago
Can I run the program without compiling?
Angius
Angius2y ago
And probably placed a breakpoint or some such, which is why the code paused execution No C# is a compiled language It needs to be compiled
shuffle
shuffleOP2y ago
The thing is it would always work int he compiler Till today
Angius
Angius2y ago
What compiler?
shuffle
shuffleOP2y ago
Debugger* Is it because I’m trying to perform file handling?
Angius
Angius2y ago
Unlikely
shuffle
shuffleOP2y ago
Oh my I found the breakpoint I see thank you Didn’t know that was a thing
Angius
Angius2y ago
$debug
MODiX
MODiX2y ago
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
Angius
Angius2y ago
Here you can read more about the debugger Breakpoints and all But if you just want to run your code, you don't need to run it through the debugger
shuffle
shuffleOP2y ago
What’s the better way to donut Do it Compile it into an end?
Angius
Angius2y ago
Just... run it
shuffle
shuffleOP2y ago
Exe
Angius
Angius2y ago
No, run the code Green arrow in the top toolbar
shuffle
shuffleOP2y ago
Ohhhh Thank you
Angius
Angius2y ago
Or F5 shortcut Assuming you're using VS 2022
shuffle
shuffleOP2y ago
F5 opens debugger for me
Angius
Angius2y ago
Ah, Ctrl+F5 then
shuffle
shuffleOP2y ago
Alright Also I just learnt about file handling This is my code
shuffle
shuffleOP2y ago
No description
shuffle
shuffleOP2y ago
No description
shuffle
shuffleOP2y ago
But I get the error could not find part of the path
Angius
Angius2y ago
Protip: you can screenshot your screen
shuffle
shuffleOP2y ago
Im at college I can’t screenshot Since I don’t hve discord on the pc
Angius
Angius2y ago
You can open it in the browser Regardless, take a good look at the path
shuffle
shuffleOP2y ago
I’ve got double slashes But it was automatically added like that Apart from that I don’t see what else the issue could be
Angius
Angius2y ago
Path in your code
No description
Angius
Angius2y ago
Path on your disk
No description
shuffle
shuffleOP2y ago
Ohhhh
Angius
Angius2y ago
Do you see the difference?
shuffle
shuffleOP2y ago
Yes Double text based Thank you haha Sometimes a second pair of eyes if very nice

Did you find this page helpful?