Hi,
I am trying to use AddEventLog for Worker Service on ASP.NET Core 3.1.3 I have installed NuGet Microsoft.Extensions.Logging.EventLog
Problem is I am getting the error 'ILoggingBuilder' does not contain a definition for 'AddEventLog'
Here is my code:
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .UseWindowsService() .ConfigureLogging((context, logging) => { logging.AddEventLog(new EventLogSettings() { SourceName = "MySource", LogName = "MyLogName" }); }) .ConfigureServices((hostContext, services) => { services.AddHostedService<Worker>(); }); }