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 ...
随机推荐
- jQuery AJAX方法 前台往后台传数据
https://blog.csdn.net/dreamstar613/article/details/61912717 http://www.cnblogs.com/zhuxiaojie/p/4783 ...
- css 获取从第n个开始,之后的所有元素
<div id="box"> <div></div> <div>等待获取</div> <div>等待获取&l ...
- <?php if($value['udertype'] == 0) {?> <td>超级管理员</td> <?php } else if ($value['udertype'] == 1)
<?php if($value['udertype'] == 0) {?> <td>超级管理员</td> <?php } else if ($value['u ...
- 传纸条---(dp)
题目描述 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题.一次素质拓展活动中,班上同学安排做成一个mmm行nnn列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就无法直接交谈了. ...
- [Day7]循环、数组方法、排序查找
1. ASCII(American Standard Code for Information Interchange) (1)数字0-9对应ASCII编码十进制为48-57, 字母a-z对应ASCI ...
- SparkContext初始化之SparkScheduler初始化
- java之jedis使用
下载 依赖jar包下载 使用 # Redis settings redis.host=192.168.208.153 redis.port=6379 redis.pass=1234 redis.tim ...
- python基础(2)-运算符&while循环
算术运算符 a=5; b=2; print(a+b);#result:7 desc:加 print(a-b);#result:3 desc:减 print(a*b);#result:10 desc:乘 ...
- [js]设计模式小结&对原型的修改
js设计模式小结 工厂模式/构造函数--减少重复 - 创建对象有new - 自动创建obj,this赋值 - 无return 原型链模式 - 进一步去重 类是函数数据类型,每个函数都有prototyp ...
- Python str byte 互相转换