Exemplo n.º 1
0
        public static async Task <IISConfiguration> LoadConfiguration(string sectionName             = null,
                                                                      bool processConfigurationHooks = true)
        {
            var configurationManager = new IISConfigurationManager();
            var configuration        = new IISConfiguration();
            await configurationManager.Initialize(configuration, sectionName);

            if (processConfigurationHooks)
            {
                await configurationManager.FindAndProcessConfigurationHooks(configuration);
            }
            return(configuration);
        }
Exemplo n.º 2
0
        private static async Task <IISConfiguration> LoadConfigurationAsync(string sectionName, Func <IISConfiguration, Task> configure)
        {
            var configuration = new IISConfiguration();
            var configManager = new IISConfigurationManager();
            await configManager.Initialize(configuration, sectionName);

#pragma warning disable 612
            await configManager.FindAndProcessConfigurationHooks(configuration);

#pragma warning restore 612
            if (configure != null)
            {
                await configure(configuration);
            }
            return(configuration);
        }