using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using ReInject; using Server; var services = Injector.GetContainer(); var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); services.Register(DependencyStrategy.AtomicInstance, true, configuration); ILoggerFactory loggerFactory = LoggerFactory.Create(builder => { builder.AddSimpleConsole(options => { options.ColorBehavior = Microsoft.Extensions.Logging.Console.LoggerColorBehavior.Enabled; options.TimestampFormat = "[HH:mm:ss]"; options.IncludeScopes = true; }); builder.AddFile("Logs/log-{0:yyyy}-{0:MM}-{0:dd}.txt", opts => opts.FormatLogFileName = fileName => String.Format(fileName, DateTime.UtcNow)); }); services.Register(DependencyStrategy.AtomicInstance, true, new AesProvider(loggerFactory, null, null)); services.Register(DependencyStrategy.AtomicInstance, true, loggerFactory); var authServer = services.GetInstance(); authServer.Start();