This post shows you how to fix 'ILoggingBuilder' does not contain a definition for 'AddNLog' and no extension method 'AddNLog' accepting a first argument of type 'ILoggingBuilder'.
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args).ConfigureLogging((hostingContext, logging) =>
{
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
logging.AddDebug();
logging.AddNLog();
}).ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
Right-clicking on your project, then select Manage Nuget Packages => Search 'NLog.Extensions.Logging' => Install it to your project.
and don't forget to add
using NLog.Extensions.Logging;
I hope so you can solve this issue by installing the Nuget Package called NLog.Extensions.Logging, it has a dependency of NLog.