Topshelf/Topshelf — pull request #173 by TravisTheTechie (2014-04-03 14:29:24+00:00)
Title: Setting ServiceBase.ServiceName so fatal errors make it to the Event Log

Moving #172 to point to the right branch.

If it's not set, an ArgumentException is thrown when the service crashes and the original Exception is never logged in the Event Log. From http://msdn.microsoft.com/en-us/library/vstudio/system.serviceprocess.servicebase.servicename.aspx

>The ServiceName is also used to specify the EventLog.Source associated with the EventLog property. This EventLog is an instance that writes service command information to the Application log.

>The ServiceName, which supplies the source string for the event log, must be set before the service writes to the event log. Trying to access the event log before the source name is set causes an exception to be thrown.

I also removed the duplicate log statement in the catch block in OnStart.