Example #1
0
        private static IWebHost BuildWebHost(string[] args, IConfigurationRoot configuration = null)
        {
            if (configuration == null)
            {
                configuration = AppConfigurationHelper.GetAppConfiguration(AppInfo.AppBasePath);
            }

            return(WebHost.CreateDefaultBuilder(args)
                   .UseConfiguration(configuration)
                   .UseStartup <Startup>()
                   .ConfigureLogging(logging =>
            {
                logging.ClearProviders();
                logging.SetMinimumLevel(LogLevel.Trace);
            })
                   // NLog: Setup NLog for Dependency injection
                   .UseNLog()
                   .Build());
        }