C
C#4mo ago
WantToBeeMe

Console.WriteLine does nothing

So i am away from my PC for a bit, and so i moved to my laptop to code there for a few days. However, for some reason the same project that i was working on works on my laptop, but just Console.WriteLine does nothing anymore. It also is not the IDE that is the problem. In fact, i could even open the project in my cmd and run dotnet run and all the Console.WriteLine() do nothing. In order to actually see something i e.g. have to use MessageBox.Show("hello world")
No description
18 Replies
WantToBeeMe
WantToBeeMeOP4mo ago
as you can see, Line 16 didnt print anything in the console. However, (line 17) MessageBos.Show did infact show
Angius
Angius4mo ago
MAUI? WPF? Those usually don't have a console window associated with them
WantToBeeMe
WantToBeeMeOP4mo ago
WPF but the thing is, it worked on my other PC XD
Angius
Angius4mo ago
¯\_(ツ)_/¯
WantToBeeMe
WantToBeeMeOP4mo ago
i know thats something you dont want to hear lol, as a programmer
Angius
Angius4mo ago
All I can say is it shouldn't have worked lol Debug.WriteLine() maybe
SG97
SG974mo ago
why do you want to print to console?
Angius
Angius4mo ago
That's also a good question
WantToBeeMe
WantToBeeMeOP4mo ago
I want to debug stuff, but i dont want to constantly get stopped by the breakpoint. If i find something, i want to be able to read the terminal and check if a method ran or not
Angius
Angius4mo ago
Use the debugger instead
SG97
SG974mo ago
you can use conditional breakpoints no need to "break" on every breakpoint
Angius
Angius4mo ago
Ah, I had the message pre-written and jumped the gun lol
SG97
SG974mo ago
they can be used to print to output assuming Rider has conditional breakpoints like VS
Angius
Angius4mo ago
Sure does
WantToBeeMe
WantToBeeMeOP4mo ago
lol then i am so confused why it worked in the first place
Angius
Angius4mo ago
VS magic?
SG97
SG974mo ago
like so
No description
SG97
SG974mo ago
they are very powerful, and there is never (well probably sometimes) a need to produce debug code
Want results from more Discord servers?
Add your server