Acquire the maindom before we do unattended installs

This commit is contained in:
Bjarke Berg
2021-05-19 20:40:06 +02:00
parent cb6f74774d
commit 80ee7b398c

View File

@@ -91,6 +91,9 @@ namespace Umbraco.Cms.Infrastructure.Runtime
AppDomain.CurrentDomain.SetData("DataDirectory", _hostingEnvironment?.MapPathContentRoot(Constants.SystemDirectories.Data));
// acquire the main domain - if this fails then anything that should be registered with MainDom will not operate
AcquireMainDom();
DoUnattendedInstall();
DetermineRuntimeLevel();
@@ -105,8 +108,7 @@ namespace Umbraco.Cms.Infrastructure.Runtime
throw new InvalidOperationException($"An instance of {typeof(IApplicationShutdownRegistry)} could not be resolved from the container, ensure that one if registered in your runtime before calling {nameof(IRuntime)}.{nameof(StartAsync)}");
}
// acquire the main domain - if this fails then anything that should be registered with MainDom will not operate
AcquireMainDom();
// if level is Run and reason is UpgradeMigrations, that means we need to perform an unattended upgrade
if (State.Reason == RuntimeLevelReason.UpgradeMigrations && State.Level == RuntimeLevel.Run)