示例#1
0
        private void CreateBootStrapper()
        {
            logger.DebugFormat("Loading {0}", assemblyName);
            var assembly = Assembly.Load(assemblyName);

            Type bootStrapperType = null;

            if (string.IsNullOrEmpty(bootStrapperName) == false)
            {
                bootStrapperType = assembly.GetType(bootStrapperName);
            }

            bootStrapperType = bootStrapperType ??
                               GetAutoBootStrapperType(assembly);
            try
            {
                bootStrapper = (AbstractBootStrapper)Activator.CreateInstance(bootStrapperType);
            }
            catch (Exception e)
            {
                throw new InvalidOperationException("Failed to create " + bootStrapperType + ".", e);
            }
        }