nikevi
nikevi

Reputation: 1

Use C# Console.WriteLine in a Windows Service

If I call Console.WriteLine in a Windows Service, are the logs written anywhere in a sort of "hidden" console?

I'm NOT interested in finding out where Windows Service writes Console.WriteLine's logs, I'm just wondering if the service still writes the log in a background console (invisible to the user) when Console.WriteLine is called.

Upvotes: 0

Views: 366

Answers (1)

Blindy
Blindy

Reputation: 67487

Services have no allocated consoles, stdout data will silently get dropped.

Unless of course at any point you attach something to it, like a debugger that hooks into stdout, in which case you'll start seeing your messages.

Upvotes: 2

Related Questions