private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options) { // Allow all https requests ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); }); var environmentInfo = GetEnvironmentInfo(); var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), environmentInfo, appPaths.TempDirectory); FileSystem = fileSystem; using (var appHost = new MonoAppHost(appPaths, logManager, options, fileSystem, new PowerManagement(), "emby.mono.zip", environmentInfo, new NullImageEncoder(), new SystemEvents(logManager.GetLogger("SystemEvents")), new NetworkManager(logManager.GetLogger("NetworkManager")))) { if (options.ContainsOption("-v")) { Console.WriteLine(appHost.ApplicationVersion.ToString()); return; } Console.WriteLine("appHost.Init"); var initProgress = new Progress <double>(); var task = appHost.Init(initProgress); Task.WaitAll(task); appHost.ImageProcessor.ImageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => appHost.HttpClient, appPaths, environmentInfo); Console.WriteLine("Running startup tasks"); task = appHost.RunStartupTasks(); Task.WaitAll(task); task = ApplicationTaskCompletionSource.Task; Task.WaitAll(task); } }
private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options) { var environmentInfo = GetEnvironmentInfo(options); var fileSystem = new ManagedFileSystem(logManager.GetLogger("FileSystem"), environmentInfo, null, appPaths.TempDirectory, true); FileSystem = fileSystem; using (var appHost = new MonoAppHost(appPaths, logManager, options, fileSystem, new PowerManagement(), "embyserver-mono_{version}.zip", environmentInfo, new NullImageEncoder(), new SystemEvents(logManager.GetLogger("SystemEvents")), new NetworkManager(logManager.GetLogger("NetworkManager"), environmentInfo))) { if (options.ContainsOption("-v")) { Console.WriteLine(appHost.ApplicationVersion.ToString()); return; } Console.WriteLine("appHost.Init"); appHost.Init(); appHost.ImageProcessor.ImageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => appHost.HttpClient, appPaths, environmentInfo, appHost.LocalizationManager); Console.WriteLine("Running startup tasks"); var task = appHost.RunStartupTasks(); Task.WaitAll(task); task = ApplicationTaskCompletionSource.Task; Task.WaitAll(task); } }