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")
18 Replies
as you can see, Line 16 didnt print anything in the console.
However, (line 17) MessageBos.Show did infact show
MAUI? WPF?
Those usually don't have a console window associated with them
WPF
but the thing is, it worked on my other PC XD
¯\_(ツ)_/¯
i know thats something you dont want to hear lol, as a programmer
All I can say is it shouldn't have worked lol
Debug.WriteLine()
maybewhy do you want to print to console?
That's also a good question
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
Use the debugger instead
you can use conditional breakpoints
no need to "break" on every breakpoint
Ah, I had the message pre-written and jumped the gun lol
they can be used to print to output
assuming Rider has conditional breakpoints like VS
Sure does
lol
then i am so confused why it worked in the first place
VS magic?
like so
they are very powerful, and there is never (well probably sometimes) a need to produce debug code