diff --git a/src/NLog.Web.AspNetCore/AspNetExtensions.cs b/src/NLog.Web.AspNetCore/AspNetExtensions.cs index 077063ae..17e1a750 100644 --- a/src/NLog.Web.AspNetCore/AspNetExtensions.cs +++ b/src/NLog.Web.AspNetCore/AspNetExtensions.cs @@ -157,7 +157,7 @@ private static void ConfigureServicesNLog(NLogAspNetCoreOptions options, IServic ConfigurationItemFactory.Default.RegisterItemsFromAssembly(typeof(AspNetExtensions).GetTypeInfo().Assembly); LogManager.AddHiddenAssembly(typeof(AspNetExtensions).GetTypeInfo().Assembly); - services.Replace(ServiceDescriptor.Singleton(serviceProvider => + services.TryAddEnumerable(ServiceDescriptor.Singleton(serviceProvider => { ServiceLocator.ServiceProvider = serviceProvider;