I created a windows form solution and in the constructor of a class I called
Console.WriteLine("constructer called")
But I only got the form and not the console.. so where is the output?
In Visual Studio uppermost menu choose Debug > Windows > Output. It shows all Console. WriteLine("Debug MyVariable: " + MyVariable) when you get to them.
Console is a predefined class of System namespace. While Write() and WriteLine() both are the Console Class methods. The only difference between the Write() and WriteLine() is that Console. Write is used to print data without printing the new line, while Console.
In project settings set application type as Console. Then you will get console window and Windows form. Show activity on this post. If you run your application in Visual Studio you can see the console output in the output window.
You should also consider using Debug.WriteLine, that's probably what you're looking for. These statements are written out the trace listeners for your application, and can be viewed in the Output Window of Visual Studio.
Debug.WriteLine("constructor fired");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With