Пример #1
0
        static int Main(string[] args)
        {
            string errorMessage = null;

            try
            {
                // The Program class cannot use Rhetos classes directly, because it needs to register assembly resolved first. Application built with DeployPackages would fail with error "Could not load file or assembly...".
                UtilityAssemblyResolver.RegisterAssemblyResolver();
                App.Run(args);
                return(0);
            }
            catch (ApplicationException ex)
            {
                errorMessage = "CANCELED: " + ex.Message;
            }
            catch (Exception ex)
            {
                errorMessage = "ERROR: " + ex;
            }

            if (errorMessage != null)
            {
                Console.WriteLine();
                Console.WriteLine(errorMessage);
                if (!args.Any(arg => arg.Equals("/nopause")))
                {
                    Console.WriteLine();
                    Console.Write("Press any key to continue . . .");
                    Console.ReadKey(true);
                }
                return(1);
            }

            return(0);
        }
Пример #2
0
 static int Main(string[] args)
 {
     // The Program class cannot use Rhetos classes directly, because it needs to register assembly resolved first. Application built with DeployPackages would fail with error "Could not load file or assembly...".
     UtilityAssemblyResolver.RegisterAssemblyResolver();
     return(App.Run(args));
 }