I have a ASP.NET MVC 6 (beta-4) app.
public void ConfigureServices(IServiceCollection services)
{
// Logging
services.AddLogging();
// ...
}
publi
I assumed that services.AddLogging(); was doing the right thing and registering ILogger. After looking at the source (https://github.com/aspnet/Logging/blob/d874c5726e713d3eb34938f85faf7be61aae0f2a/src/Microsoft.Framework.Logging/LoggingServiceCollectionExtensions.cs) I found that it's actually registering ILogger<>. Changing the signature of ILogger to ILogger makes the above example work.
public class HomeController :
Controller
{
ILogger _logger;
public HomeController(ILogger logger)
{
_logger = logger;
}
// ...
}
Thanks to @Steve for setting me on the right track to find this.