Exemplo n.º 1
0
        public void Configuration(IAppBuilder app)
        {
            // Skip initialization if module is not defined
            var moduleDefinition = ModuleDefinitionController.GetModuleDefinitionByFriendlyName(Globals.ModuleFriendlyName);

            if (Null.IsNull(moduleDefinition))
            {
                return;
            }

            Logger.Debug("Starting up DNN Dev Tools");

            // Wire up SignalR
            app.MapSignalR();

            // Configure Log4Net appender
            var root = ((log4net.Repository.Hierarchy.Hierarchy)LogManager.GetRepository()).Root;

            root.Level = Level.All;
            var attachable = (IAppenderAttachable)root;
            var appender   = new Log4NetAppender();

            attachable.AddAppender(appender);

            // Start mail pickup folder watcher
            MailPickupFolderWatcher.Instance.Run();

            // Start event watcher
            DnnEventWatcher.Instance.Run();
        }
Exemplo n.º 2
0
        public void run_the_task()
        {
            if (this.loggingHelper.HasLoggedErrors)
            {
                return;
            }

            Log4NetAppender.configure_without_console();
            ApplicationConfiguraton.set_defaults_if_properties_are_not_set(this);


            if (Restore && string.IsNullOrEmpty(RestoreFromPath))
            {
                throw new Exception(
                          "If you set Restore to true, you must specify a location for the database to be restored from. That property is RestoreFromPath in MSBuild.");
            }

            ApplicationConfiguraton.build_the_container(this);

            IRunner roundhouse_runner = new RoundhouseMigrationRunner(
                RepositoryPath,
                Container.get_an_instance_of <EnvironmentSet>(),
                Container.get_an_instance_of <KnownFolders>(),
                Container.get_an_instance_of <FileSystemAccess>(),
                Container.get_an_instance_of <DatabaseMigrator>(),
                Container.get_an_instance_of <VersionResolver>(),
                Silent,
                Drop,
                DoNotCreateDatabase,
                WithTransaction,
                this);

            roundhouse_runner.run();
        }
Exemplo n.º 3
0
        private static void Main(string[] args)
        {
            Log4NetAppender.configure();

            try
            {
                // determine if this a call to the diff or the migrator
                if (string.Join("|", args).to_lower().Contains("version") && args.Length == 1)
                {
                    report_version();
                }
                else if (string.Join("|", args).to_lower().Contains("rh.redgate.diff"))
                {
                    run_diff_utility(set_up_configuration_and_build_the_container(args));
                }
                else
                {
                    run_migrator(set_up_configuration_and_build_the_container(args));
                }

                Environment.Exit(0);
            }
            catch (Exception ex)
            {
                the_logger.Info(ex.Message);
                Environment.Exit(1);
            }
        }
Exemplo n.º 4
0
        public void Init()
        {
            // Configure NServiceBus.

            var logAppender = new Log4NetAppender(typeof(EndpointConfig));

            NServiceBus.SetLoggingLibrary.Log4Net(null, logAppender);

            NServiceBus.Configure.With()
            .Log4Net(logAppender)
            .UnityBuilder(Container.Current)
            .BinarySerializer();
        }
Exemplo n.º 5
0
        private static void Main(string[] args)
        {
            Log4NetAppender.configure();

            init_security_protocol();

            int exit_code = 0;

            try
            {
                // determine if this a call to the diff, the migrator, or the init
                if (string.Join("|", args).to_lower().Contains("version") && args.Length == 1)
                {
                    report_version();
                }
                else if (string.Join("|", args).to_lower().Contains("rh.redgate.diff"))
                {
                    run_diff_utility(set_up_configuration_and_build_the_container(args));
                }
                else if (string.Join("|", args).to_lower().Contains("isuptodate"))
                {
                    run_update_check(set_up_configuration_and_build_the_container(args));
                }
                else if (args.Any() && args[0] == "init")
                {
                    var cf = set_up_configuration_and_build_the_container(args, Mode.Init);
                    init_folder(cf);
                }
                else
                {
                    var cf = set_up_configuration_and_build_the_container(args);
                    run_migrator(cf);
                }
            }


            catch (Exception ex)
            {
                the_logger.Error(ex.Message, ex);
                exit_code = 1;
            }
            finally
            {
#if DEBUG
                System.Console.WriteLine("Press any key to continue...");
                System.Console.ReadKey();
#endif
                Environment.Exit(exit_code);
            }
        }
Exemplo n.º 6
0
        public void Debug_migrator()
        {
            var args = new []
            {
                @"/db=TestRoundhousE",
                @"/f=..\..\db\MySQL\TestRoundhousE",
                //@"/cs=server=localhost;uid=username;Password=password;database=TestRoundhousE;",
                @"/cs=server=tcdev02;uid=alexey.diyan;Password=03ambul19G;database=TestRoundhousE;",
                @"/dt=roundhouse.databases.mysql.MySqlDatabase, roundhouse.databases.mysql",
                @"/schemaname=TestRoundhousE"
            };

            Log4NetAppender.configure();
            Program.run_migrator(Program.set_up_configuration_and_build_the_container(args));
        }
Exemplo n.º 7
0
        public void Init()
        {
            // Configure NServiceBus.

            var logAppender = new Log4NetAppender(typeof(EndpointConfig));

            NServiceBus.SetLoggingLibrary.Log4Net(null, logAppender);

            NServiceBus.Configure.With()
            .Log4Net(logAppender)
            .UnityBuilder(Container.Current)
            .BinarySerializer();

            // Create and initialize WCF host.

            var host = Container.Current.Resolve <WcfTcpHost>();

            Container.Current.RegisterInstance(host); // force instance to be a singleton
            host.Open();
        }
Exemplo n.º 8
0
        private static void Main(string[] args)
        {
            Log4NetAppender.configure();

            int exit_code = 0;

            try
            {
                // determine if this a call to the diff or the migrator
                if (string.Join("|", args).to_lower().Contains("version") && args.Length == 1)
                {
                    report_version();
                }
                else if (string.Join("|", args).to_lower().Contains("rh.redgate.diff"))
                {
                    run_diff_utility(set_up_configuration_and_build_the_container(args));
                }
                else
                {
                    run_migrator(set_up_configuration_and_build_the_container(args));
                }
            }
            catch (Exception ex)
            {
                the_logger.Error(ex.Message, ex);
                exit_code = 1;
            }
            finally
            {
#if DEBUG
                System.Console.WriteLine("Press any key to continue...");
                System.Console.ReadKey();
#endif
                Environment.Exit(exit_code);
            }
        }
        private static void initialize_file_log_appender()
        {
            var known_folders = Container.get_an_instance_of <KnownFolders>();

            Log4NetAppender.set_file_appender(known_folders.change_drop.folder_full_path);
        }