private ILoggerFactory ConfigureLogging(ILoggerFactory factory)
{
factory.AddConsole();
return factory;
}
Saya telah menemukan potongan kode di atas di Github . Ini memberikan kesalahan berikut:
'ILoggerFactory' does not contain a definition for 'AddConsole' and the best extension method overload 'ConsoleLoggerExtensions.AddConsole(ILoggingBuilder)' requires a receiver of type 'ILoggingBuilder'
Saya menggunakan NET Core 3.0 dan saya telah menginstal paket NuGet berikut.
<PackageReference Include="Discord.Net" Version="2.1.1" />
<PackageReference Include="Discord.Net.Commands" Version="2.1.1" />
<PackageReference Include="Discord.Net.WebSocket" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.0.0" />
Mengapa saya mendapatkan itu ILoggerFactory
tidak memiliki metode AddConsole()
? Bagaimana saya bisa memperbaikinya?
AddConsole
definisi metode termasuk dalam apa yang Anda nyatakan dengan using
pernyataan?