小编San*_*yev的帖子

.net标准1.3项目中的log4net配置

我试图将ac#项目从.net框架v4.6迁移到.net标准。该项目具有log4net v2.0.8依赖性。

我找到了这个SO anwser,它建议使用.net standard 1.3,并提供了这篇文章的参考,以获取更多详细的解决方案。

使用XmlConfigurator.Configure方法(需要ILoggerRepository第一个参数)配置log4net时会发生问题。

在帖子中LogManager.GetRepository(Assembly.GetEntryAssembly())使用的方法,但是Assembly.GetEntryAssembly()是不支持在.NET 1.3标准。

官方文档也被破坏了,因为XmlConfigurator.Configure方法签名及其示例用法不匹配。

那么,如何在.net标准1.3项目中配置log4net?

c# log4net .net-standard

2
推荐指数
1
解决办法
943
查看次数

标签 统计

.net-standard ×1

c# ×1

log4net ×1