Skip to content

Commit

Permalink
Fixed bug introduced with IServiceCollection.Replace. Instead use Try…
Browse files Browse the repository at this point in the history
…AddEnumerable

# Conflicts:
#	src/NLog.Web.AspNetCore/AspNetExtensions.cs
  • Loading branch information
snakefoot authored and 304NotModified committed Sep 30, 2019
1 parent 456ad60 commit 822f2f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NLog.Web.AspNetCore/AspNetExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ILoggerProvider, NLogLoggerProvider>(serviceProvider =>
services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, NLogLoggerProvider>(serviceProvider =>
{
ServiceLocator.ServiceProvider = serviceProvider;

Expand Down

0 comments on commit 822f2f5

Please sign in to comment.