From fa802decc3993e437b87ec44f951bbcd3cee4d14 Mon Sep 17 00:00:00 2001 From: Rolf Kristensen Date: Tue, 24 Sep 2019 22:25:14 +0200 Subject: [PATCH] IHostingEnvironment is obsolete in NetCore3. Instead use ILoggingBuilder.ConfigureNLog (#478) --- src/NLog.Web.AspNetCore/AspNetExtensions.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NLog.Web.AspNetCore/AspNetExtensions.cs b/src/NLog.Web.AspNetCore/AspNetExtensions.cs index 077063ae..2479d020 100644 --- a/src/NLog.Web.AspNetCore/AspNetExtensions.cs +++ b/src/NLog.Web.AspNetCore/AspNetExtensions.cs @@ -28,7 +28,7 @@ public static class AspNetExtensions /// /// #if ASP_NET_CORE2 - [Obsolete("Use UseNLog() on IWebHostBuilder")] + [Obsolete("Use UseNLog() on IWebHostBuilder / IHostBuilder")] #endif public static void AddNLogWeb(this IApplicationBuilder app) { @@ -41,6 +41,9 @@ public static void AddNLogWeb(this IApplicationBuilder app) /// /// relative path to NLog configuration file. /// LoggingConfiguration for chaining +#if ASP_NET_CORE2 + [Obsolete("Use ConfigureNLog() on ILoggingBuilder. Or UseNLog() on IWebHostBuilder / IHostBuilder")] +#endif public static LoggingConfiguration ConfigureNLog(this IHostingEnvironment env, string configFileRelativePath) { ConfigurationItemFactory.Default.RegisterItemsFromAssembly(typeof(AspNetExtensions).GetTypeInfo().Assembly);