'm trying to add Event logging to an ASP.NET Core 1.1 Web Api (running on Windows Server 2012) as such:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); loggerFactory.AddEventLog(); }
But it tells me:
'ILoggerFactory' does not contain a definition for 'AddEventLog' and no extension method 'AddEventLog' accepting a first argument of type 'ILoggerFactory' could be found (are you missing a using directive or an assembly reference?)
I've tried to add "Microsoft.Extensions.Logging.EventLog" to the project via NuGet, but it says:
Package Microsoft.Extensions.Logging.EventLog 1.1.2 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Extensions.Logging.EventLog 1.1.2 supports: net451 (.NETFramework,Version=v4.5.1) One or more packages are incompatible with .NETCoreApp,Version=v1.1. Package restore failed. Rolling back package changes for 'PropWorx.API'.
I guess this means it's not possible to log to the Windos Event system on .Net Core 1.1?
Thanks