‘ILoggerFactory’ does not contain a definition for ‘AddConsole’

I just ran into this following a course on Pluralsight. I got ahead of myself before the next slide explaining why their .AddConsole was working in the ILoggerFactory.Create.

Even though you only need using Microsoft.Extensions.Logging in your class, you need to explicitly add a package reference to your .Net Core app in order for the .AddConsole method to be found.

dotnet add package Microsoft.Extensions.Logging.Console

and add this using statement to your code

using Microsoft.Extensions.Logging;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)