public static async Task Main(string[] args) { log.Info("Starting {0} version utility...", Assembly.GetExecutingAssembly().GetName().Version); var feeds = await new FeedsFactory().Read().ConfigureAwait(false); var builder = new ServiceCollection(); builder.RegisterModule <LoggingModule>(); builder.RegisterModule <MainNewsModule>(); builder.RegisterModule <CommonModule>(); builder.RegisterModule(DelfiModule.CreateWithFeeds("Data", feeds)); builder.RegisterModule( new NetworkModule(new RetrieveConfiguration { LongDelay = 60 * 20, CallDelay = 0, ShortDelay = 1000, LongRetryCodes = new[] { HttpStatusCode.Forbidden, }, RetryCodes = new[] { HttpStatusCode.Forbidden, HttpStatusCode.RequestTimeout, // 408 HttpStatusCode.InternalServerError, // 500 HttpStatusCode.BadGateway, // 502 HttpStatusCode.ServiceUnavailable, // 503 HttpStatusCode.GatewayTimeout // 504 }, MaxConcurrent = 1 })); var container = builder.BuildServiceProvider(); ILoggerFactory loggerFactory = container.GetRequiredService <ILoggerFactory>(); loggerFactory.AddNLog(new NLogProviderOptions { CaptureMessageTemplates = true, CaptureMessageProperties = true }); IArticlesMonitor monitor = container.GetRequiredService <IArticlesMonitor>(); "Data".EnsureDirectoryExistence(); IArticlesPersistency persistency = container.GetRequiredService <IArticlesPersistency>(); monitor.NewArticlesStream().Subscribe(item => persistency.Save(item)); monitor.MonitorUpdatesStream().Subscribe(item => persistency.Save(item)); Console.ReadLine(); }