In a C # .NET GUI application. I also need a console in the background for some tasks. Basically, I use the Thrid Party library for some processing (takes a lot of time), which writes intermediate results to the console. This processing is a computational task of time. So, I assign this task to a background worker. I mean, the background worker calls these library functions. But the problem is that I have no way to show the status of the user of the calculation, because I do not have the source of the library. I was hoping the console would be shown. But surprisingly Console.WriteLine does not seem to work. I mean, the console window is not displayed. Why?
EDIT:
I tried setting the application type = console. But it seems to be a problem. Only the main thread can access the console. Only the Console.WriteLine console, executed by the main (Application) thread, is displayed on the console. Console.WriteLine , executed by other (BackgroundWorker) GUI threads, the output is not displayed. I need a console only for background workers. I mean, when the background worker starts up, the console starts up and when it ends, the console shuts down.
source share