I want to create a windows service that validates data and access it from another windows application, but I\'m new to services and I\'m not sure how to start.
So,
Your service, while it is processing, can add events to the EventLog.
You can create another console application that runs paralel to the service, and that listens to that EventLog with the event handling mechanism:
var log= new EventLog("[name of the eventlog]");
log.EnableRaisingEvents = true;
log.EntryWritten += Log_EntryWritten;
Then you handle it immediately:
private static void Log_EntryWritten(object sender, System.Diagnostics.EntryWrittenEventArgs e)
{
Console.WriteLine("Event detected !");
}
You can read the EntryWrittenEventArgs object to get all event details, and to show what you want in your console app. If you stop the console app the service continues to run, and still logs to the event log.