I created an ASP.NET Core 3.0 Web Application with the default template in Visual Studio 2019 Preview 2.2 and tried to inject an ILogger in Startup:
namespace We
Did you have using ServiceCollection to register the Logger yet! It's should be here.
serviceProvider.AddTransient(typeof(ILogger<>), (typeof(Logger<>));
or you put, this is sample for Program.cs
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureLogging(logging => logging.SetMinimumLevel(LogLevel.Warning))
.UseStartup()
.Build();
}