Search code examples
c#consolewinforms-interop

c#: Winform App Running a Console Performance Issue


I have a Windows Forms app that is able to open up a console for debugging purposes. Everything is running fine except that I have noticed the following console-related issue:

  1. The console window is open. I open up a csv file, read it, and write its contents straight to the console. The csv file has about 1200 lines of data. Even though all the data lines are read and written to the console, only the last 500 lines of the csv file data are actually visible and accessible in the console window. Why? Can this be changed so that all the data become accessible in the console window?

Also, are there any performance-related issuess I need to be aware of?

Thanks for your help.


Solution

  • Windows consoles store a limited amount of text in their buffer.
    Once you fill the buffer, every line you print will cause it to discard its oldest line.

    You can change the buffer size in the console's Properties.