Quantcast
Channel: Photon Server — Photon Engine
Viewing all articles
Browse latest Browse all 1557

AppDomain.CurrentDomain.UnhandledException is Not Called

$
0
0
I've got a similar problem as described in thread https://forum.photonengine.com/discussion/9955/unhandled-exception-handler-not-called. The difference is that we would like to do more than just logging: we would like to create a memory dump so any crash could be analyzed.
public class MyApplication : ApplicationBase
{
    protected override void Setup()
    {
        // ...
        AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
        // ...
    }

    private static void AppDomain_OnUnhandledException(object sender, UnhandledExceptionEventArgs args)
    {
        _log.Fatal(args.ExceptionObject);
        MemoryDump.MiniDump.Create(Process.GetCurrentProcess(), Path.Combine(Path.GetTempPath(), "MyApplication.dmp"));
    }
}
I made sure the the Unhandled Exception Policy is configured as "TerminateProcess" so Photon will not swallow all the exceptions. This information was available here: https://doc.photonengine.com/en-us/server/current/app-framework/exception-handling#configuring_the_unhandledexception_policy The server application now closes if an exception happens (opposed to the "Ignore" option), but the UnhadnledException callback is still not called. The version of the Photon Server I'm running is 4.0.29.11263 Any help would be appreciated.

Viewing all articles
Browse latest Browse all 1557

Trending Articles