You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understood the code correctly, the library is catching unhandled exceptions and then calls Win32ServiceHost.ReportServiceStatus without throwing the exception?
Is there a way to notify the application about such an exception?
…So that the application for example can write a last “emergency” log statement bevor it exits.
Maybe an event similar to AppDomain.CurrentDomain.UnhandledException?
Btw.
Really cool library, thanks for sharing it.
The text was updated successfully, but these errors were encountered:
I've already heard feedback about not really being able to debug exceptions. The problem with throwing is that it breaks the connection to windows' service management system.
I'm open to suggestions for how to handle this best.
The netfx ServiceBase reports to the event log, which also isn't available in .net core yet, it will be part of the windows compatibility pack in the .net core 2.1 timeframe. This also contains ServiceBase for .net core which kind of obsoletes part of this library (except for service creation/update/delete).
Two options:
Wait until .NET Core 2.1 release and write to the event log on windows (the compatibility pack should be available for netstandard2.0 but released alongside .NET Core 2.1). I don't want to create another PInvoke wrapper over the event log APIs, esp. since there is one coming in the compatibility pack.
Provide a hook on the service host like events, IExceptionReporter or similar.
Hi Martin
If I understood the code correctly, the library is catching unhandled exceptions and then calls Win32ServiceHost.ReportServiceStatus without throwing the exception?
Is there a way to notify the application about such an exception?
…So that the application for example can write a last “emergency” log statement bevor it exits.
Maybe an event similar to AppDomain.CurrentDomain.UnhandledException?
Btw.
Really cool library, thanks for sharing it.
The text was updated successfully, but these errors were encountered: