-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to register a global exception handler. Such as An equivalent to AppDomain.UnhandledException #45
Comments
Have you tried:
|
@ragnarol |
HI @gitfortee , no it was introduced in .net core 2. Anyway I think you should close this issue and make this question in Stackoverflow, is probably the right place for it as it is not related to this library. Said that, your other question about the installation of the service maybe related to your version of .net core as well, I have only tried with 2,0 |
@ragnarol understood.. can you please post some code if you have that goes inside the |
Ok. this is what i found out.. the service started working once i upgraded to .net core version 2.0 !!! To recap, even with .net core version 1.1, there was no difficulty in running the application stand-alone or as a service with a "local system" account. The service started to fail only when i configured it to run using a service account.. However, with the same service account and after upgrading my projects and libraries to core version 2.0, the service is working fine.. strange.!! @PeterKottas do you like this be documented somewhere? please let me know |
Hi guys, sorry for late reply. Thanks for getting my back @ragnarol ! Appreciated. Well this is a rather small lib so there's no great support for legacy sdk versions. That would obviously require some extra effort with testing and all and it just makes more sense to keep this up to date with Microsoft and hope people will do the same. SDK updates after all are fairly painless these days. It's a good point so I am glad it's here in the issue but overall, I don't think we need an extra docs about this. If you want, you can PR readme and add a small foot note there. But the general rule would be to keep the SDK updated. |
I am getting errors like
Error 1053: The service did not respond to the start or control request in a timely fashion.
Upon examining the 'Event Log', I could see
This illustrates that I have not registered a global exception handler such as listening to the
AppDomain.UnhandledException
OrThreadPool.UnhandledException
How do i register for these events ?
wrapping up the
ServiceRunner<ServiceApp>.Run
inside atry - catch
does not capture the details of this0xe0434352
exception. Looks like the catch block itself is not executed. This is the only try-catch block i have. The code is not swallowing any exceptions..The text was updated successfully, but these errors were encountered: