Post merge fixes

This commit is contained in:
Bjarke Berg
2020-09-07 15:28:58 +02:00
parent e5bb9a22d0
commit 3efee8284a
7 changed files with 85 additions and 76 deletions

View File

@@ -10,24 +10,20 @@ namespace Umbraco.Web.Common.AspNetCore
{
public class AspNetCoreHostingEnvironment : Core.Hosting.IHostingEnvironment
{
private readonly HostingSettings _hostingSettings;
private IOptionsMonitor<HostingSettings> _hostingSettings;
private readonly IWebHostEnvironment _webHostEnvironment;
private string _localTempPath;
public AspNetCoreHostingEnvironment(IOptionsMonitor<HostingSettings> hostingSettings, IWebHostEnvironment webHostEnvironment)
{
_hostingSettings = hostingSettings.CurrentValue ?? throw new ArgumentNullException(nameof(hostingSettings));
_hostingSettings = hostingSettings ?? throw new ArgumentNullException(nameof(hostingSettings));
_webHostEnvironment = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment));
SiteName = webHostEnvironment.ApplicationName;
ApplicationId = AppDomain.CurrentDomain.Id.ToString();
ApplicationPhysicalPath = webHostEnvironment.ContentRootPath;
//TODO how to find this, This is a server thing, not application thing.
ApplicationVirtualPath = _hostingSettings.ApplicationVirtualPath?.EnsureStartsWith('/')
?? "/";
IISVersion = new Version(0, 0); // TODO not necessary IIS
}
@@ -37,8 +33,9 @@ namespace Umbraco.Web.Common.AspNetCore
public string ApplicationPhysicalPath { get; }
public string ApplicationServerAddress { get; }
public string ApplicationVirtualPath { get; }
public bool IsDebugMode => _hostingSettings.Debug;
//TODO how to find this, This is a server thing, not application thing.
public string ApplicationVirtualPath => _hostingSettings.CurrentValue.ApplicationVirtualPath?.EnsureStartsWith('/') ?? "/";
public bool IsDebugMode => _hostingSettings.CurrentValue.Debug;
public Version IISVersion { get; }
public string LocalTempPath
@@ -48,7 +45,7 @@ namespace Umbraco.Web.Common.AspNetCore
if (_localTempPath != null)
return _localTempPath;
switch (_hostingSettings.LocalTempStorageLocation)
switch (_hostingSettings.CurrentValue.LocalTempStorageLocation)
{
case LocalTempStorage.AspNetTemp: