Resolve review comments
This commit is contained in:
@@ -11,6 +11,11 @@ namespace Umbraco.Web.Common.Builder
|
||||
{
|
||||
public class UmbracoBuilder : IUmbracoBuilder
|
||||
{
|
||||
public IServiceCollection Services { get; }
|
||||
public IConfiguration Config { get; }
|
||||
public TypeLoader TypeLoader { get; }
|
||||
public ILoggerFactory BuilderLoggerFactory { get; }
|
||||
|
||||
private readonly Dictionary<Type, ICollectionBuilder> _builders = new Dictionary<Type, ICollectionBuilder>();
|
||||
|
||||
public UmbracoBuilder(IServiceCollection services, IConfiguration config, TypeLoader typeLoader)
|
||||
@@ -25,13 +30,6 @@ namespace Umbraco.Web.Common.Builder
|
||||
TypeLoader = typeLoader;
|
||||
}
|
||||
|
||||
public IServiceCollection Services { get; }
|
||||
public IConfiguration Config { get; }
|
||||
|
||||
|
||||
public TypeLoader TypeLoader { get; }
|
||||
public ILoggerFactory BuilderLoggerFactory { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection builder (and registers the collection).
|
||||
/// </summary>
|
||||
@@ -50,8 +48,6 @@ namespace Umbraco.Web.Common.Builder
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Build()
|
||||
{
|
||||
foreach (var builder in _builders.Values)
|
||||
|
||||
@@ -55,5 +55,7 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
void DetermineRuntimeLevel();
|
||||
|
||||
void Configure(RuntimeLevel level, RuntimeLevelReason reason);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Persistence
|
||||
/// </remarks>
|
||||
// TODO: these comments are not true anymore
|
||||
// TODO: this class needs not be disposable!
|
||||
internal class UmbracoDatabaseFactory : DisposableObjectSlim, IUmbracoDatabaseFactory
|
||||
public class UmbracoDatabaseFactory : DisposableObjectSlim, IUmbracoDatabaseFactory
|
||||
{
|
||||
private readonly IDbProviderFactoryCreator _dbProviderFactoryCreator;
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Hosting;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace Umbraco.Core.Runtime
|
||||
namespace Umbraco.Infrastructure.Runtime
|
||||
{
|
||||
public class CoreRuntime : IRuntime
|
||||
{
|
||||
@@ -60,7 +61,7 @@ namespace Umbraco.Core.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(Start)}");
|
||||
|
||||
// acquire the main domain - if this fails then anything that should be registered with MainDom will not operate
|
||||
AcquireMainDom(_mainDom, _applicationShutdownRegistry);
|
||||
AcquireMainDom();
|
||||
|
||||
// create & initialize the components
|
||||
_components.Initialize();
|
||||
@@ -68,16 +69,16 @@ namespace Umbraco.Core.Runtime
|
||||
|
||||
public void Terminate()
|
||||
{
|
||||
_components?.Terminate();
|
||||
_components.Terminate();
|
||||
}
|
||||
|
||||
private void AcquireMainDom(IMainDom mainDom, IApplicationShutdownRegistry applicationShutdownRegistry)
|
||||
private void AcquireMainDom()
|
||||
{
|
||||
using (var timer = _profilingLogger.DebugDuration<CoreRuntime>("Acquiring MainDom.", "Acquired."))
|
||||
{
|
||||
try
|
||||
{
|
||||
mainDom.Acquire(applicationShutdownRegistry);
|
||||
_mainDom.Acquire(_applicationShutdownRegistry);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -105,10 +106,7 @@ namespace Umbraco.Core.Runtime
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
// BOO a cast, yay no CoreRuntimeBootstrapper
|
||||
((RuntimeState)State).Level = RuntimeLevel.BootFailed;
|
||||
((RuntimeState)State).Reason = RuntimeLevelReason.BootFailedOnException;
|
||||
State.Configure(RuntimeLevel.BootFailed, RuntimeLevelReason.BootFailedOnException);
|
||||
timer?.Fail();
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.Builder;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace Umbraco.Core.Runtime
|
||||
{
|
||||
public class RuntimeEssentialsEventArgs : EventArgs
|
||||
{
|
||||
public RuntimeEssentialsEventArgs(IUmbracoBuilder builder, IUmbracoDatabaseFactory databaseFactory)
|
||||
{
|
||||
Builder = builder;
|
||||
DatabaseFactory = databaseFactory;
|
||||
}
|
||||
|
||||
public IUmbracoBuilder Builder { get; }
|
||||
|
||||
public IUmbracoDatabaseFactory DatabaseFactory { get; }
|
||||
}
|
||||
}
|
||||
@@ -161,6 +161,12 @@ namespace Umbraco.Core
|
||||
Reason = RuntimeLevelReason.UpgradeMigrations;
|
||||
}
|
||||
|
||||
public void Configure(RuntimeLevel level, RuntimeLevelReason reason)
|
||||
{
|
||||
Level = level;
|
||||
Reason = reason;
|
||||
}
|
||||
|
||||
private bool EnsureUmbracoUpgradeState(IUmbracoDatabaseFactory databaseFactory, ILogger logger)
|
||||
{
|
||||
var upgrader = new Upgrader(new UmbracoPlan(_umbracoVersion));
|
||||
|
||||
@@ -92,9 +92,6 @@
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
||||
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
||||
<_Parameter1>Umbraco.Web.Common</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -14,6 +14,7 @@ using Umbraco.Core.Builder;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Configuration.Models;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.Mappers;
|
||||
using Umbraco.Core.Runtime;
|
||||
@@ -61,9 +62,15 @@ namespace Umbraco.Tests.Integration
|
||||
services.AddRequiredNetCoreServices(testHelper, webHostEnvironment);
|
||||
|
||||
// Add it!
|
||||
var typeLoader = services.AddTypeLoader(GetType().Assembly, webHostEnvironment, testHelper.GetHostingEnvironment(),
|
||||
testHelper.ConsoleLoggerFactory, AppCaches.NoCache, hostContext.Configuration);
|
||||
|
||||
var typeLoader = services.AddTypeLoader(
|
||||
GetType().Assembly,
|
||||
webHostEnvironment,
|
||||
testHelper.GetHostingEnvironment(),
|
||||
testHelper.ConsoleLoggerFactory,
|
||||
AppCaches.NoCache,
|
||||
hostContext.Configuration,
|
||||
testHelper.Profiler);
|
||||
|
||||
var builder = new UmbracoBuilder(services, hostContext.Configuration, typeLoader, testHelper.ConsoleLoggerFactory);
|
||||
builder.Services.AddUnique<AppCaches>(AppCaches.NoCache);
|
||||
builder.AddConfiguration();
|
||||
@@ -105,9 +112,14 @@ namespace Umbraco.Tests.Integration
|
||||
|
||||
// Add it!
|
||||
|
||||
var typeLoader = services.AddTypeLoader(GetType().Assembly,
|
||||
webHostEnvironment, testHelper.GetHostingEnvironment(), testHelper.ConsoleLoggerFactory, AppCaches.NoCache,
|
||||
hostContext.Configuration);
|
||||
var typeLoader = services.AddTypeLoader(
|
||||
GetType().Assembly,
|
||||
webHostEnvironment,
|
||||
testHelper.GetHostingEnvironment(),
|
||||
testHelper.ConsoleLoggerFactory,
|
||||
AppCaches.NoCache,
|
||||
hostContext.Configuration,
|
||||
testHelper.Profiler);
|
||||
|
||||
var builder = new UmbracoBuilder(services, hostContext.Configuration, typeLoader, testHelper.ConsoleLoggerFactory);
|
||||
builder.Services.AddUnique<AppCaches>(AppCaches.NoCache);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Builder;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Runtime;
|
||||
using Umbraco.Extensions;
|
||||
using Umbraco.Tests.Integration.Implementations;
|
||||
using Umbraco.Web.Common.Builder;
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace Umbraco.Tests.Integration.TestServerTest
|
||||
builder.AddUmbracoCore();
|
||||
|
||||
builder.Services.AddUnique<AppCaches>(AppCaches.NoCache);
|
||||
|
||||
builder.Services.AddUnique<IUmbracoBootPermissionChecker>(Mock.Of<IUmbracoBootPermissionChecker>());
|
||||
builder.Services.AddUnique<IMainDom>(testHelper.MainDom);
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Umbraco.Tests.Integration.TestServerTest
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
var typeLoader = services.AddTypeLoader(GetType().Assembly, TestHelper.GetWebHostEnvironment(), TestHelper.GetHostingEnvironment(),
|
||||
TestHelper.ConsoleLoggerFactory, AppCaches.NoCache, Configuration);
|
||||
TestHelper.ConsoleLoggerFactory, AppCaches.NoCache, Configuration, TestHelper.Profiler);
|
||||
|
||||
var builder = new UmbracoBuilder(services, Configuration, typeLoader);
|
||||
|
||||
|
||||
@@ -57,8 +57,6 @@ namespace Umbraco.Tests.Integration.Testing
|
||||
|
||||
builder.Services.AddUnique<IServerMessenger, NoopServerMessenger>();
|
||||
builder.Services.AddUnique<IProfiler, TestProfiler>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -174,7 +174,14 @@ namespace Umbraco.Tests.Integration.Testing
|
||||
|
||||
// Add it!
|
||||
|
||||
var typeLoader = services.AddTypeLoader(GetType().Assembly, webHostEnvironment, TestHelper.GetHostingEnvironment(), TestHelper.ConsoleLoggerFactory, AppCaches.NoCache, Configuration);
|
||||
var typeLoader = services.AddTypeLoader(
|
||||
GetType().Assembly,
|
||||
webHostEnvironment,
|
||||
TestHelper.GetHostingEnvironment(),
|
||||
TestHelper.ConsoleLoggerFactory,
|
||||
AppCaches.NoCache,
|
||||
Configuration,
|
||||
TestHelper.Profiler);
|
||||
var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory);
|
||||
|
||||
|
||||
@@ -184,8 +191,6 @@ namespace Umbraco.Tests.Integration.Testing
|
||||
.AddUmbracoCore();
|
||||
|
||||
builder.Services.AddUnique<AppCaches>(GetAppCaches());
|
||||
|
||||
|
||||
builder.Services.AddUnique<IUmbracoBootPermissionChecker>(Mock.Of<IUmbracoBootPermissionChecker>());
|
||||
builder.Services.AddUnique<IMainDom>(TestHelper.MainDom);
|
||||
|
||||
|
||||
@@ -250,7 +250,6 @@ namespace Umbraco.Tests.Integration.Umbraco.Infrastructure.Persistence.Repositor
|
||||
}
|
||||
|
||||
[Test]
|
||||
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Boot = true)]
|
||||
public void Get_Paged_Child_Entities_By_Parent_Id()
|
||||
{
|
||||
CreateTestDataForPagingTests(out var createdContent, out var createdMembers, out _);
|
||||
|
||||
@@ -30,10 +30,6 @@ namespace Umbraco.Extensions
|
||||
public static IUmbracoBuilder AddBackOffice(this IUmbracoBuilder builder)
|
||||
{
|
||||
builder.Services.AddAntiforgery();
|
||||
|
||||
// TODO: We had this check in v8 where we don't enable these unless we can run...
|
||||
//if (runtimeState.Level != RuntimeLevel.Upgrade && runtimeState.Level != RuntimeLevel.Run) return app;
|
||||
|
||||
builder.Services.AddSingleton<IFilterProvider, OverrideAuthorizationFilterProvider>();
|
||||
builder.Services
|
||||
.AddAuthentication(Core.Constants.Security.BackOfficeAuthenticationType)
|
||||
|
||||
@@ -4,9 +4,12 @@ using Microsoft.Extensions.Options;
|
||||
namespace Umbraco.Web.Common.AspNetCore
|
||||
{
|
||||
/// <summary>
|
||||
/// OptionsMonitor but without the monitoring
|
||||
/// HACK: OptionsMonitor but without the monitoring, hopefully temporary.
|
||||
/// This is just used so we can get an AspNetCoreHostingEnvironment to
|
||||
/// build a TypeLoader long before ServiceProvider is built.
|
||||
/// </summary>
|
||||
public class OptionsMonitorAdapter<T> : IOptionsMonitor<T> where T : class, new()
|
||||
[Obsolete("Please let the container wire up a real OptionsMonitor for you")]
|
||||
internal class OptionsMonitorAdapter<T> : IOptionsMonitor<T> where T : class, new()
|
||||
{
|
||||
private readonly T _inner;
|
||||
|
||||
@@ -26,6 +29,5 @@ namespace Umbraco.Web.Common.AspNetCore
|
||||
}
|
||||
|
||||
public T CurrentValue => _inner;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,10 +34,12 @@ using Umbraco.Core.Runtime;
|
||||
using Umbraco.Extensions;
|
||||
using Umbraco.Infrastructure.HostedServices;
|
||||
using Umbraco.Infrastructure.HostedServices.ServerRegistration;
|
||||
using Umbraco.Infrastructure.Runtime;
|
||||
using Umbraco.Web.Common.ApplicationModels;
|
||||
using Umbraco.Web.Common.AspNetCore;
|
||||
using Umbraco.Web.Common.Filters;
|
||||
using Umbraco.Web.Common.ModelBinders;
|
||||
using Umbraco.Web.Common.Profiler;
|
||||
using IHostingEnvironment = Umbraco.Core.Hosting.IHostingEnvironment;
|
||||
|
||||
namespace Umbraco.Web.Common.Builder
|
||||
@@ -55,9 +57,8 @@ namespace Umbraco.Web.Common.Builder
|
||||
|
||||
var loggingConfig = new LoggingConfiguration(Path.Combine(webHostEnvironment.ContentRootPath, "umbraco", "logs"));
|
||||
|
||||
var hostingSettings = config.GetSection(Core.Constants.Configuration.ConfigHosting).Get<HostingSettings>() ?? new HostingSettings();
|
||||
var hostingEnvironment = new AspNetCoreHostingEnvironment(new OptionsMonitorAdapter<HostingSettings>(hostingSettings), webHostEnvironment);
|
||||
services.AddLogger(hostingEnvironment, loggingConfig, config);
|
||||
var tempHostingEnvironment = GetTemporaryHostingEnvironment(webHostEnvironment, config);
|
||||
services.AddLogger(tempHostingEnvironment, loggingConfig, config);
|
||||
|
||||
IHttpContextAccessor httpContextAccessor = new HttpContextAccessor();
|
||||
services.AddSingleton(httpContextAccessor);
|
||||
@@ -66,8 +67,11 @@ namespace Umbraco.Web.Common.Builder
|
||||
var appCaches = AppCaches.Create(requestCache);
|
||||
services.AddUnique<AppCaches>(appCaches);
|
||||
|
||||
var profiler = GetWebProfiler(config);
|
||||
services.AddUnique<IProfiler>(profiler);
|
||||
|
||||
var loggerFactory = LoggerFactory.Create(cfg => cfg.AddSerilog(Log.Logger, false));
|
||||
var typeLoader = services.AddTypeLoader(Assembly.GetEntryAssembly(), webHostEnvironment, hostingEnvironment, loggerFactory, appCaches, config);
|
||||
var typeLoader = services.AddTypeLoader(Assembly.GetEntryAssembly(), webHostEnvironment, tempHostingEnvironment, loggerFactory, appCaches, config, profiler);
|
||||
|
||||
return new UmbracoBuilder(services, config, typeLoader, loggerFactory);
|
||||
}
|
||||
@@ -79,15 +83,6 @@ namespace Umbraco.Web.Common.Builder
|
||||
|
||||
builder.Services.AddLazySupport();
|
||||
|
||||
// Add service session
|
||||
// This can be overwritten by the user by adding their own call to AddSession
|
||||
// since the last call of AddSession take precedence
|
||||
builder.Services.AddSession(options =>
|
||||
{
|
||||
options.Cookie.Name = "UMB_SESSION";
|
||||
options.Cookie.HttpOnly = true;
|
||||
});
|
||||
|
||||
// Add supported databases
|
||||
builder.AddUmbracoSqlCeSupport();
|
||||
builder.AddUmbracoSqlServerSupport();
|
||||
@@ -114,8 +109,6 @@ namespace Umbraco.Web.Common.Builder
|
||||
: new MainDomSemaphoreLock(loggerFactory.CreateLogger<MainDomSemaphoreLock>(), hostingEnvironment);
|
||||
});
|
||||
|
||||
var profiler = UmbracoCoreServiceCollectionExtensions.GetWebProfiler(builder.Config);
|
||||
builder.Services.AddUnique<IProfiler>(profiler);
|
||||
builder.Services.AddUnique<IIOHelper, IOHelper>();
|
||||
builder.Services.AddUnique<IAppPolicyCache>(factory => factory.GetRequiredService<AppCaches>().RuntimeCache);
|
||||
builder.Services.AddUnique<IRequestCache>(factory => factory.GetRequiredService<AppCaches>().RequestCache);
|
||||
@@ -236,6 +229,15 @@ namespace Umbraco.Web.Common.Builder
|
||||
|
||||
public static IUmbracoBuilder AddWebComponents(this IUmbracoBuilder builder)
|
||||
{
|
||||
// Add service session
|
||||
// This can be overwritten by the user by adding their own call to AddSession
|
||||
// since the last call of AddSession take precedence
|
||||
builder.Services.AddSession(options =>
|
||||
{
|
||||
options.Cookie.Name = "UMB_SESSION";
|
||||
options.Cookie.HttpOnly = true;
|
||||
});
|
||||
|
||||
builder.Services.ConfigureOptions<UmbracoWebServiceCollectionExtensions.UmbracoMvcConfigureOptions>();
|
||||
builder.Services.TryAddEnumerable(ServiceDescriptor.Transient<IApplicationModelProvider, UmbracoApiBehaviorApplicationModelProvider>());
|
||||
builder.Services.TryAddEnumerable(ServiceDescriptor.Transient<IApplicationModelProvider, BackOfficeApplicationModelProvider>());
|
||||
@@ -314,5 +316,35 @@ namespace Umbraco.Web.Common.Builder
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static IProfiler GetWebProfiler(IConfiguration config)
|
||||
{
|
||||
var isDebug = config.GetValue<bool>($"{Core.Constants.Configuration.ConfigHosting}:Debug");
|
||||
// create and start asap to profile boot
|
||||
if (!isDebug)
|
||||
{
|
||||
// should let it be null, that's how MiniProfiler is meant to work,
|
||||
// but our own IProfiler expects an instance so let's get one
|
||||
return new VoidProfiler();
|
||||
}
|
||||
|
||||
var webProfiler = new WebProfiler();
|
||||
webProfiler.StartBoot();
|
||||
|
||||
return webProfiler;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HACK: returns an AspNetCoreHostingEnvironment that doesn't monitor changes to configuration.<br/>
|
||||
/// We require this to create a TypeLoader during ConfigureServices.<br/>
|
||||
/// Instances returned from this method shouldn't be registered in the service collection.
|
||||
/// </summary>
|
||||
private static IHostingEnvironment GetTemporaryHostingEnvironment(IWebHostEnvironment webHostEnvironment, IConfiguration config)
|
||||
{
|
||||
var hostingSettings = config.GetSection(Core.Constants.Configuration.ConfigHosting).Get<HostingSettings>() ?? new HostingSettings();
|
||||
var wrappedHostingSettings = new OptionsMonitorAdapter<HostingSettings>(hostingSettings);
|
||||
|
||||
return new AspNetCoreHostingEnvironment(wrappedHostingSettings, webHostEnvironment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,31 +65,19 @@ namespace Umbraco.Extensions
|
||||
return services;
|
||||
}
|
||||
|
||||
internal static IProfiler GetWebProfiler(IConfiguration config)
|
||||
internal static ITypeFinder AddTypeFinder(
|
||||
this IServiceCollection services,
|
||||
ILoggerFactory loggerFactory,
|
||||
IWebHostEnvironment webHostEnvironment,
|
||||
Assembly entryAssembly,
|
||||
IConfiguration config,
|
||||
IProfilingLogger profilingLogger)
|
||||
{
|
||||
var isDebug = config.GetValue<bool>($"{Constants.Configuration.ConfigHosting}:Debug");
|
||||
// create and start asap to profile boot
|
||||
if (!isDebug)
|
||||
{
|
||||
// should let it be null, that's how MiniProfiler is meant to work,
|
||||
// but our own IProfiler expects an instance so let's get one
|
||||
return new VoidProfiler();
|
||||
}
|
||||
|
||||
var webProfiler = new WebProfiler();
|
||||
webProfiler.StartBoot();
|
||||
|
||||
return webProfiler;
|
||||
}
|
||||
|
||||
internal static ITypeFinder AddTypeFinder(this IServiceCollection services, ILoggerFactory loggerFactory, IWebHostEnvironment webHostEnvironment, Assembly entryAssembly, IConfiguration config)
|
||||
{
|
||||
var profiler = GetWebProfiler(config);
|
||||
|
||||
var typeFinderSettings = config.GetSection(Core.Constants.Configuration.ConfigTypeFinder).Get<TypeFinderSettings>() ?? new TypeFinderSettings();
|
||||
|
||||
var runtimeHashPaths = new RuntimeHashPaths().AddFolder(new DirectoryInfo(Path.Combine(webHostEnvironment.ContentRootPath, "bin")));
|
||||
var runtimeHash = new RuntimeHash(new ProfilingLogger(loggerFactory.CreateLogger<ProfilingLogger>(), profiler), runtimeHashPaths);
|
||||
var runtimeHash = new RuntimeHash(profilingLogger, runtimeHashPaths);
|
||||
|
||||
var typeFinder = new TypeFinder(
|
||||
loggerFactory.CreateLogger<TypeFinder>(),
|
||||
@@ -103,20 +91,20 @@ namespace Umbraco.Extensions
|
||||
return typeFinder;
|
||||
}
|
||||
|
||||
internal static TypeLoader AddTypeLoader(
|
||||
public static TypeLoader AddTypeLoader(
|
||||
this IServiceCollection services,
|
||||
Assembly entryAssembly,
|
||||
IWebHostEnvironment webHostEnvironment,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
ILoggerFactory loggerFactory,
|
||||
AppCaches appCaches,
|
||||
IConfiguration configuration)
|
||||
IConfiguration configuration,
|
||||
IProfiler profiler)
|
||||
{
|
||||
var typeFinder = services.AddTypeFinder(loggerFactory, webHostEnvironment, entryAssembly, configuration);
|
||||
var profilingLogger = new ProfilingLogger(loggerFactory.CreateLogger<ProfilingLogger>(), profiler);
|
||||
var typeFinder = services.AddTypeFinder(loggerFactory, webHostEnvironment, entryAssembly, configuration, profilingLogger);
|
||||
|
||||
var profilingLogger = new ProfilingLogger(loggerFactory.CreateLogger<ProfilingLogger>(), GetWebProfiler(configuration));
|
||||
|
||||
var typeLoader = new TypeLoader(
|
||||
var typeLoader = new TypeLoader(
|
||||
typeFinder,
|
||||
appCaches.RuntimeCache,
|
||||
new DirectoryInfo(hostingEnvironment.LocalTempPath),
|
||||
@@ -128,15 +116,5 @@ namespace Umbraco.Extensions
|
||||
|
||||
return typeLoader;
|
||||
}
|
||||
|
||||
internal class AspNetCoreBootPermissionsChecker : IUmbracoBootPermissionChecker
|
||||
{
|
||||
public void ThrowIfNotPermissions()
|
||||
{
|
||||
// nothing to check
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,9 +34,6 @@
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
||||
<_Parameter1>Umbraco.Tests.UnitTests</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
||||
<_Parameter1>Umbraco.Tests.Integration</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user