diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index bae97c17ec..0620469c0f 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -557,6 +557,8 @@ namespace Emby.Server.Implementations
: typeof(NullImageEncoder);
serviceCollection.AddSingleton(typeof(IImageEncoder), imageEncoderType);
+ serviceCollection.AddSingleton(_startupOptions);
+
serviceCollection.AddMemoryCache();
serviceCollection.AddSingleton(ConfigurationManager);
diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
index 8e97719311..af1604aa6e 100644
--- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
+++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
@@ -16,17 +16,25 @@ namespace Emby.Server.Implementations.EntryPoints
private readonly IServerApplicationHost _appHost;
private readonly IConfiguration _appConfig;
private readonly IServerConfigurationManager _config;
+ private readonly IStartupOptions _startupOptions;
///
/// Initializes a new instance of the class.
///
/// The application host.
+ /// The application configuration.
/// The configuration manager.
- public StartupWizard(IServerApplicationHost appHost, IConfiguration appConfig, IServerConfigurationManager config)
+ /// The application startup options.
+ public StartupWizard(
+ IServerApplicationHost appHost,
+ IConfiguration appConfig,
+ IServerConfigurationManager config,
+ IStartupOptions startupOptions)
{
_appHost = appHost;
_appConfig = appConfig;
_config = config;
+ _startupOptions = startupOptions;
}
///
@@ -47,9 +55,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
else if (_config.Configuration.AutoRunWebApp)
{
- var options = ((ApplicationHost)_appHost).StartupOptions;
-
- if (!options.NoAutoRunWebApp)
+ if (!_startupOptions.NoAutoRunWebApp)
{
BrowserLauncher.OpenWebApp(_appHost);
}