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