场景重现

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:ERROR ConfigureFromXml called with null 'element' parameter的更多相关文章

  1. 操作MyBatis引发Error setting null for parameter #X with JdbcType OTHER .无效的列类型

    再用MyBatis操作Oracle的时候,传入null值而引发的错误 异常信息: org.springframework.jdbc.UncategorizedSQLException: Error s ...

  2. 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 ...

  3. 又一个无效的列类型错误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 ...

  4. 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 ...

  5. hive分区导致FAILED: Hive Internal Error: java.lang.NullPointerException(null)

    写了一条hive sql ,其中条件中存在 dt>=20150101 and dt<=20150228 这样的条件,原来执行没问题,今天就抛出 FAILED: Hive Internal ...

  6. 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 ...

  7. log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [File] to set object on [TF.Log.FileAppender]

    难受,香菇. 大概研究了两个多小时,搜了很多资料都没有很完美的答案,最后突然脑子就一闪一闪,才弄明白咋回事. log4net:ERROR XmlHierarchyConfigurator: Canno ...

  8. uiautomatorviewer 查看元素报错: Error taking device screenshot: null 原因

    使用uiautomatorviewer 查看android某些页面元素,出现错误Error obtaining UI hierarchy  Reason: Error taking device sc ...

  9. Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty 报错

    项目中遇到的获取https的数据接口数据时,Unexpected error: java.security.InvalidAlgorithmParameterException: the trustA ...

随机推荐

  1. [LeetCode] Majority Element II 求大多数之二

    Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The a ...

  2. vue项目实战中的增、删、改、查

    参考:https://blog.csdn.net/xr510002594/article/details/81665762?utm_source=blogxgwz0 https://blog.csdn ...

  3. HBuilder控制台集成命令提示符(终端/CMD)功能

    参考:https://jingyan.baidu.com/album/6b97984dc9cda31ca2b0bf00.html?picindex=3

  4. react 使用 lazyload 懒加载图片

    文档地址 index.html <script> (function(w, d) { var b = d.getElementsByTagName("body")[0] ...

  5. 协程greenlet、gevent

    greenlet为了更好使用协程来完成多任务,python中greenlet模块对其封装,从而使得切换任务变得更加简单安装方式 pip3 install greenlet 示例代码: from gre ...

  6. 怎么在Centos7 下让我的mariadb开机启动?(已解决)

    以前我经常使用syscemctl工具在开机后执行 systemctl start mariadb (哈哈,打得可6,只是有点儿麻烦), 如果能开机自启动mariadb就好了. 所以,我想百度下看什么命 ...

  7. httpClient实例--返回响应部分并且转换成对象

    import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import ja ...

  8. PHP调用接口用post方法传送json数据

    1.核心代码: <?php require("helper.php"); header('content-type:text/html;charset=utf-8'); $k ...

  9. Vue Watch 的原理 和 $nextTick() 通俗理解

    网上watch和$nextTick()解释比较复杂,涉及到promise,h5的dom发生变化的新api等复杂代码,下列就是两个参考. [watch原理] [$nextTick()] 首先,看遇到问题 ...

  10. GreenDao开源ORM框架浅析

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u011133213/article/details/37738943 Android程序开发中,避免 ...