public static AppDomainSetup CreateAppDomainSetup(RdbmsToolsParameters rdbmsToolsParameters)
        {
            AppDomainSetup appDomainSetup = new AppDomainSetup();

            appDomainSetup.ApplicationName = "RdbmsTools";
            appDomainSetup.ApplicationBase = rdbmsToolsParameters.BaseDirectory;

            if (!string.IsNullOrEmpty(rdbmsToolsParameters.ConfigFile))
            {
                appDomainSetup.ConfigurationFile = Path.GetFullPath(rdbmsToolsParameters.ConfigFile);
                if (!File.Exists(appDomainSetup.ConfigurationFile))
                {
                    throw new FileNotFoundException(
                              string.Format(
                                  "The configuration file supplied by the 'config' parameter was not found.\r\nFile: {0}",
                                  appDomainSetup.ConfigurationFile),
                              appDomainSetup.ConfigurationFile);
                }
            }
            return(appDomainSetup);
        }
 protected RdbmsToolsRunner(AppDomainSetup appDomainSetup, RdbmsToolsParameters rdbmsToolsParameters)
     : base(appDomainSetup)
 {
     _rdbmsToolsParameters = rdbmsToolsParameters;
 }
        public static RdbmsToolsRunner Create(RdbmsToolsParameters rdbmsToolsParameters)
        {
            AppDomainSetup appDomainSetup = CreateAppDomainSetup(rdbmsToolsParameters);

            return(new RdbmsToolsRunner(appDomainSetup, rdbmsToolsParameters));
        }