C
C#2y ago
Cheetah

Ok so i DID NOT add hello world to my code but it still appears

my code for some ungodly reason has decided to not use my code and use a previous code when i run and i dontt tknow why pls help me
35 Replies
Anchy
Anchy2y ago
probably keep all your issues to 1 thread it doesnt look like ur debugging so are you manually running the file?
Cheetah
CheetahOP2y ago
ok like just edit the hread
Anchy
Anchy2y ago
if so you need to recompile
Angius
Angius2y ago
F5, IIRC Or click the green arrow That's how you should run it in VS
Cheetah
CheetahOP2y ago
i use ctrl + f5 to do it
Angius
Angius2y ago
That seems fine, then
Cheetah
CheetahOP2y ago
but it still isnttt the code i have tthere
Angius
Angius2y ago
Yes, that part is not fine
Angius
Angius2y ago
I'm wondering about those errors:
Angius
Angius2y ago
Can you try restarting VS and see if those errors, and your issue, persist?
Cheetah
CheetahOP2y ago
i restarted it a sec ago the errors went away the issue still there
Angius
Angius2y ago
Huh Sometimes, when VS cannot compile the current version for some reason, it will run the last version that did compile
Anchy
Anchy2y ago
show your program.cs
Angius
Angius2y ago
But the code looks like it should compile just fine
Anchy
Anchy2y ago
in ur last screenshot in the last thread it looks like the code does exactly that
Angius
Angius2y ago
Second screenshot
Anchy
Anchy2y ago
o
Angius
Angius2y ago
So, what version of .NET is this project using?
Anchy
Anchy2y ago
int Number++; does that even compile
Angius
Angius2y ago
Ah, it probably does not
Cheetah
CheetahOP2y ago
idk ive tried withtout intt and it worked and now itt dontt anymore
Angius
Angius2y ago
Yeah, that's not valid code
Anchy
Anchy2y ago
so its uses last compile
Cheetah
CheetahOP2y ago
int
Angius
Angius2y ago
It's a redeclaration of the variable
Cheetah
CheetahOP2y ago
so i need to puttt itt somewhere else or just remove it
Anchy
Anchy2y ago
remove the type specifier
Angius
Angius2y ago
Keep just one declaration, as you have it int Number = 0; But when you use it, don't specify the type
Cheetah
CheetahOP2y ago
hold on
Angius
Angius2y ago
Just do Number++
Cheetah
CheetahOP2y ago
ok so ok but idk if it was when i reset it but the code wentt to what was running so idk what happened i forgot to check code agian after restarting visual sttudio ok itts fixed
Anchy
Anchy2y ago
probably repair your IDE as it would have told you the issue if it wasnt broken
Angius
Angius2y ago
Good point, it should be lit up in red on a variable redeclaration
JenyaRostov
JenyaRostov2y ago
doesn't visual studio prompt you to run last successfully compiled code
blueberriesiftheywerecats
Because you have error and you activated run last compiled code feature

Did you find this page helpful?