static void Main(string[] args) { try { ContainerUtils.RegisterDependencies(Container); Application = Container.Get <IProgram>(); var runSettings = Utils.ParseCommandLineArguments(args); Application.Run(runSettings); } catch (ArgumentException ex) { Console.WriteLine($"Application failed due to wrong arguments message : {ex.Message}"); } catch (FormatException ex) { Console.WriteLine($"Application failed due to wrong format message : {ex.Message}"); } catch (SocketException ex) { Console.WriteLine($"Application connection failed due to : {ex.Message}"); } catch (Exception ex) { Console.WriteLine( $"Application failed with an unexpected exception message : {ex.Message} stack trace : {ex.StackTrace} and inner exception : {ex.InnerException?.Message}"); } finally { Console.ReadKey(); } }