C
C#2y ago
Nicholas

Help with counter

https://paste.ofcode.org/SD2dfetkQpeUsDmrMVbDab not sure why its not working thanks ❤️
26 Replies
Angius
Angius2y ago
Define "not working" Does the counter not increment? Does it crash? Is the output not what it should be?
Nicholas
NicholasOP2y ago
yes everytime I run the code it doesn't count up and just closes
Angius
Angius2y ago
Add Console.ReadLine() at the very end VS just closes the console when the program finishes running, by default
Nicholas
NicholasOP2y ago
i got an error tho
Angius
Angius2y ago
It can be changed somewhere in the settings, IIRC, but a Console.ReadLine() or even a Console.Read() is a quick way to basically add "press any key to continue"
Nicholas
NicholasOP2y ago
No description
Angius
Angius2y ago
What error? ;
Nicholas
NicholasOP2y ago
yeah m dumb
Angius
Angius2y ago
Now it will wait for Enter before closing
Nicholas
NicholasOP2y ago
m still didn't work that's odd it counted to one then closed
Angius
Angius2y ago
Try Tools->Options->Debugging->Automatically close the console Disable that
Nicholas
NicholasOP2y ago
under which sub tab is it in
Nicholas
NicholasOP2y ago
this?
No description
Angius
Angius2y ago
Yeah I see it's disabled already
Nicholas
NicholasOP2y ago
yepp
Angius
Angius2y ago
Try runnin without debug Ctrl+F5 instead of F5
Nicholas
NicholasOP2y ago
I just click the play button i tried urs still closed again that's odd
Angius
Angius2y ago
Aight Try Tools -> Options -> Project and Solutions -> Build and run Set On run, when build or deployment errors occur... to Do not launch
Nicholas
NicholasOP2y ago
I did still closed
Nicholas
NicholasOP2y ago
No description
Angius
Angius2y ago
Huh Try .Read() instead of .ReadLine()...?
Nicholas
NicholasOP2y ago
Got some help and it worked thanks!
Pobiega
Pobiega2y ago
I'm 99% sure you have "run latest build if compilation failed" turned on which is just a terrible setting that should be removed, imho
JimmahDean
JimmahDean2y ago
mine doesn't and i'm pretty sure i didn't change the setting?
Angius
Angius2y ago
Maybe it's no longer enabled by default
deem
deem2y ago
@crayy

Did you find this page helpful?