0

I have a C# console application that sends constant output to the console via console.writeline. Works fine if I invoke it manually. Now I want it to be started by task scheduler. The app is started OK, but the output does not appear anywhere. The data is real time output so writing to a file is not an option.

How do I get it to show?

GrandpaG
  • 11
  • 1
  • 3
  • https://stackoverflow.com/questions/186822/capturing-console-output-from-a-net-application-c – Torge Rosendahl May 25 '20 at 14:01
  • That is not the same concept. The reference looks like it runs an app to completion and then displays all the output generated from the completed application. Maybe I wasn't clear, but the output for me is real time, i.e. the app never ends so you can't wait to get the completed output. I need the output WHILE the app is running, not after it completes, because it doesn't (shouldn't). – GrandpaG May 25 '20 at 14:55
  • This seems like a possible solution: https://stackoverflow.com/questions/8662024/how-do-i-capture-the-output-of-a-script-if-it-is-being-ran-by-the-task-scheduler/8662086 – drewburlingame Jun 05 '20 at 18:34
  • drewburlingame - again you are giving responses that are not for the question. Your reference uses output files to capture the output and used after the application terminates. Also, I am asking about a windows service, not a scheduled task. – GrandpaG Jun 06 '20 at 21:55

1 Answers1

0

I cant write a comment (less than 50 rep), but you might also want look into this? Where is Task Scheduler console output? (C# console app) I know that this is for files again..

If your application does not have to be that real-time capable you can print the output into a text file and read that file from another program. If you do this remember to check if the file is available or right now read or written to by the other program

Torge Rosendahl
  • 482
  • 6
  • 17