Я обновляю проект netcore 2.0 до netcore2.1
У меня есть базовый тестовый контроллер, который создает регистратор, например:
public class WSTestController
{
protected readonly ILogger _log;
protected readonly HttpClient _client;
protected readonly IServiceCollection _services;
public WSTestController() {
_log = new LoggerFactory().AddConsole().CreateLogger(this.GetType().Name);
var testContext = new TestContext();
_client = testContext.Client;
}
Это нормально работает с netcore 2.0, но в netcore 2.1 я получаю следующую ошибку:
controllers/WSTestController.cs(22,40): error CS1061:
'LoggerFactory' does not contain a definition for 'AddConsole' and no accessible extension method 'AddConsole' accepting a first argument of type 'LoggerFactory' could be found
(are you missing a using directive or an assembly reference?) [[...]/src/mtss-ws.integrationtests/mtss-ws.integrationtests.csproj]
Как я могу вручную создать консольный логгер (то есть без DI) в netvore 2.1?