On an ASP.NET Core 1.1 Web API, when using ILogger in my controller, this works fine:
public class UsersController : Controller { private readonly SharedDataContext _context; private readonly ILogger _logger; public UsersController(SharedDataContext context, ILoggerFactory logger) { _context = context; _logger = logger; } }
but this:
public class UsersController : Controller { private readonly SharedDataContext _context; private readonly ILogger<UsersController> _logger; public UsersController(SharedDataContext context, ILoggerFactory<UsersController> logger) { _context = context; _logger = logger; } }
gives me this error:
The non-generic type 'ILoggerFactory' cannot be used with type arguments
Any ideas? Thanks...