I am trying to configure NLog in my Azure Function solution, unfortunately I am getting an error as below.
'ILoggingBuilder' does not contain a definition for 'AddNLog' and no accessible extension method 'AddNLog' accepting a first argument of type 'ILoggingBuilder' could be found
Please be noted that I had already installed the NLog Nuget package to my project. Here is the code I am using in my Startup.cs file.
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using NLog;
[assembly: FunctionsStartup(typeof(Adapter.Startup))]
namespace Adapter {
public class Startup: FunctionsStartup {
public override void Configure(IFunctionsHostBuilder builder) {
builder.Services.AddHttpClient();
builder.Services.AddLogging(logBuilder = >{
logBuilder.AddNLog();
});
}
}
}
Have you ever faced this issue?
