From 44462ce7a19c69de2f013802aff1c4a785d66bc2 Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Tue, 31 Oct 2023 15:28:56 +0100 Subject: [PATCH] Fix warning CS0618: 'IHostingEnvironment.MapPathContentRoot(string)' is obsolete. --- tests/Umbraco.TestData/LoadTestController.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Umbraco.TestData/LoadTestController.cs b/tests/Umbraco.TestData/LoadTestController.cs index 741fe4e94b81..676b5c0256ea 100644 --- a/tests/Umbraco.TestData/LoadTestController.cs +++ b/tests/Umbraco.TestData/LoadTestController.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Hosting; using Umbraco.Cms.Core; +using Umbraco.Cms.Core.Extensions; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Strings; @@ -99,7 +100,7 @@ @inject Umbraco.Cms.Core.Configuration.IUmbracoVersion _umbracoVersion private readonly IDataTypeService _dataTypeService; private readonly IFileService _fileService; private readonly IHostApplicationLifetime _hostApplicationLifetime; - private readonly IHostingEnvironment _hostingEnvironment; + private readonly IHostEnvironment _hostEnvironment; private readonly IShortStringHelper _shortStringHelper; public LoadTestController( @@ -108,7 +109,7 @@ public LoadTestController( IDataTypeService dataTypeService, IFileService fileService, IShortStringHelper shortStringHelper, - IHostingEnvironment hostingEnvironment, + IHostEnvironment hostEnvironment, IHostApplicationLifetime hostApplicationLifetime) { _contentTypeService = contentTypeService; @@ -116,7 +117,7 @@ public LoadTestController( _dataTypeService = dataTypeService; _fileService = fileService; _shortStringHelper = shortStringHelper; - _hostingEnvironment = hostingEnvironment; + _hostEnvironment = hostEnvironment; _hostApplicationLifetime = hostApplicationLifetime; } @@ -321,7 +322,7 @@ private void DoRestart() public IActionResult ColdBootRestart() { Directory.Delete( - _hostingEnvironment.MapPathContentRoot(Path.Combine(Constants.SystemDirectories.TempData, "DistCache")), + _hostEnvironment.MapPathContentRoot(Path.Combine(Constants.SystemDirectories.TempData, "DistCache")), true); DoRestart();