rod*_*ght 5 c# log4net .net-6.0
我曾经使用.NET core 5,但现在我尝试使用.NET core 6,似乎旧的Startup.cs
现在与.NET core混合在一起Program.cs
。
问题是我正在尝试将 log4net 添加到我的项目中,它给了我一个错误,我不确定发生了什么或者我丢失了一些东西。错误说:
Severity Code Description Project File Line Suppression State
Error CS1061 'ILoggingBuilder' does not contain a definition for 'AddLog4Net' and no accessible extension method 'AddLog4Net' accepting a first argument of type 'ILoggingBuilder' could be found
Run Code Online (Sandbox Code Playgroud)
Program.cs
我已经通过 Nuget Managment 和 Package Manager Console 安装了 log4net 似乎没有任何作用,这是我的文件的一部分:
Severity Code Description Project File Line Suppression State
Error CS1061 'ILoggingBuilder' does not contain a definition for 'AddLog4Net' and no accessible extension method 'AddLog4Net' accepting a first argument of type 'ILoggingBuilder' could be found
Run Code Online (Sandbox Code Playgroud)
小智 4
您需要一个单独的扩展包才能使其在大多数用例中工作。
您需要的包是: https ://www.nuget.org/packages/Microsoft.Extensions.Logging.Log4Net.AspNetCore/
文档和来源: https ://github.com/huorswords/Microsoft.Extensions.Logging.Log4Net.AspNetCore
归档时间: |
|
查看次数: |
11696 次 |
最近记录: |