log4net:ERROR ConfigureFromXml called with null 'element' parameter
场景重现
ASP.NET Core 下集成 log4net 时, 运行时报错如下:
log4net:ERROR ConfigureFromXml called with null 'element' parameter
解决办法
找个一圈后, 发现是 log4net.config 的问题
<!-- log4net.config -->
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<log4net>
<!-- more... -->
<log4net>
<configuration>
去掉 <configuration> 节点, 让 <log4net> 作为最外层节点即可.
<!-- log4net.config -->
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- more... -->
<log4net>
后续
但是 Visual Studio 小哥会丢个波浪线和警告出来, 令人懊恼, 何解?


参考
- log4net/Config/XmlConfigurator.cs
- log4net:ERROR ConfigureFromXml called with null 'element' parameter
log4net:ERROR ConfigureFromXml called with null 'element' parameter的更多相关文章
- 操作MyBatis引发Error setting null for parameter #X with JdbcType OTHER .无效的列类型
再用MyBatis操作Oracle的时候,传入null值而引发的错误 异常信息: org.springframework.jdbc.UncategorizedSQLException: Error s ...
- Error setting null for parameter #10 with JdbcType
转: Error setting null for parameter #10 with JdbcType OTHER . 2014年02月23日 11:00:33 厚积 阅读数 58535 my ...
- 又一个无效的列类型错误Error setting null for parameter #7 with JdbcType NULL . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLExcept
在更新数据时候出现的错误 更新代码如下: <update id="modify" parameterType="Standard"> update ...
- HiveServer2 的jdbc方式创建udf的修改(add jar 最好不要使用),否则会造成异常: java.sql.SQLException: Error while processing statement: null
自从Hive0.13.0开始,使用HiveServer2 的jdbc方式创建udf的临时函数的方法由: ADD JAR ${HiveUDFJarPath} create TEMPORARY funct ...
- hive分区导致FAILED: Hive Internal Error: java.lang.NullPointerException(null)
写了一条hive sql ,其中条件中存在 dt>=20150101 and dt<=20150228 这样的条件,原来执行没问题,今天就抛出 FAILED: Hive Internal ...
- VS error 全集(error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'char *' to 'LPCTSTR'的解决方法)
我用的是VS2005,在编译MFC时遇到了如下错误: error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'char ...
- log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [File] to set object on [TF.Log.FileAppender]
难受,香菇. 大概研究了两个多小时,搜了很多资料都没有很完美的答案,最后突然脑子就一闪一闪,才弄明白咋回事. log4net:ERROR XmlHierarchyConfigurator: Canno ...
- uiautomatorviewer 查看元素报错: Error taking device screenshot: null 原因
使用uiautomatorviewer 查看android某些页面元素,出现错误Error obtaining UI hierarchy Reason: Error taking device sc ...
- Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty 报错
项目中遇到的获取https的数据接口数据时,Unexpected error: java.security.InvalidAlgorithmParameterException: the trustA ...
随机推荐
- C语言定义的操作mysql数据库的接口
编写的环境:centos7系统下,对mysql的衍生mariadb进行数据库的操作,包含设置访问数据库的参数,查询数据库和增删改数据库的三个功能.对于查询数据库,我这里允许不返回查询结果,用于判断查询 ...
- python全栈开发 * 32知识点汇总 * 180717
32 网络编程 (一)一.架构 定义:程序员开发的一种模式. 分类: C/S 架构 C/S即:Client与Server , 客户端/ 服务器模式 . 缺点 : 冗余 B/S 架构 Browser与S ...
- 常用C++面试总结
指定对齐值:#pragma pack(n),n=1,2,4,8,16改变系统的对齐系数struct和union都是由多个不同的数据类型成员组成, 但在任何同一时刻, union中只存放了一个被选中的成 ...
- Prometheus监控学习记录
官方文档 Prometheus基础文档 从零开始:Prometheus 进阶之路:Prometheus —— 技巧篇 进阶之路:Prometheus —— 理解篇 prometheus的数据类型介绍 ...
- CentOS最小化系统,怎么安装图形界面
CentOS最小化系统做服务器,都是没有图形界面的.很多初学者不习惯命令行操作,那么应该怎么安装图形界面?本经验咗嚛以centos6.5系统为例 方法步骤: 首先进入centos系统界面,先测 ...
- ZOJ 4060 - Flippy Sequence - [思维题][2018 ACM-ICPC Asia Qingdao Regional Problem C]
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4060 题意: 给出两个 $0,1$ 字符串 $S,T$,现在你有 ...
- Web开发——HTML基础(HTML响应式Web设计 Bootstrap)
参考: 参考:http://www.bootcss.com/ 目录: 1.什么是响应式 Web 设计? 2.创建自己的响应设计 3.使用 Bootstrap 1.什么是响应式 Web 设计? RWD ...
- SparkContext初始化之SparkScheduler初始化
- Jmeter使用之-断言
添加响应断言 ,一般下面这样选择断言的设置就可以了 个人习惯是直接从响应数据中直接复制正确的接口返回值到断言的测试模式中,如下 !!!但是这样复制的是有问题的 ,需要在测试模式中去掉 ...
- python框架之Django(10)-Form组件
介绍 我们之前在HTML页面中利用form表单向后端提交数据时,都会写一些获取用户输入的标签并且用form标签把它们包起来.与此同时我们在好多场景下都需要对用户的输入做校验,比如校验用户是否输入,输入 ...