main
 1using System;
 2using Gorilla.Commons.Infrastructure.Container;
 3using Gorilla.Commons.Infrastructure.Logging;
 4using gorilla.commons.infrastructure.threading;
 5using Rhino.Queues;
 6
 7namespace presentation.windows.server
 8{
 9    class Program
10    {
11        static void Main()
12        {
13            try
14            {
15                AppDomain.CurrentDomain.UnhandledException += (o, e) =>
16                {
17                    (e.ExceptionObject as Exception).add_to_log();
18                };
19                AppDomain.CurrentDomain.ProcessExit += (o, e) =>
20                {
21                    "shutting down".log();
22                    try
23                    {
24                        Resolve.the<CommandProcessor>().stop();
25                        Resolve.the<IQueueManager>().Dispose();
26                    }
27                    catch { }
28                    Environment.Exit(Environment.ExitCode);
29                };
30                ServerBootstrapper.run();
31                Console.ReadLine();
32            }
33            catch (Exception e)
34            {
35                e.add_to_log();
36                Console.Out.WriteLine(e);
37                Console.ReadLine();
38            }
39        }
40    }
41}