예제 #1
0
        static App()
        {
            ExecutablePath = Assembly.GetExecutingAssembly().Location;

            // nothing can be called or loaded before this call is done.
            AssemblyResolutionHelper.SetupEmbeddedAssemblyResolve();
        }
예제 #2
0
        static void Main(string[] args)
        {
            AssemblyResolutionHelper.SetupEmbeddedAssemblyResolve();
            AppDomain.CurrentDomain.UnhandledException += (sender, a) =>
            {
                if (Log.Logger == null)
                {
                    return;
                }
                if (a.IsTerminating)
                {
                    Log.Logger.Fatal(a.ExceptionObject as Exception, "Unhandled Exception");
                }
                else
                {
                    Log.Logger.Information(
                        a.ExceptionObject as Exception,
                        "Non-Fatal Unhandled Exception");
                }
            };

            app = new RunServiceApp();
            app.Run();
        }