Unrecognized configuration section log4net

前端 未结 3 1093
离开以前
离开以前 2021-01-03 17:30

I have this code in web.config:


  
    
    

        
相关标签:
3条回答
  • 2021-01-03 17:54
    <configuration>
        <configSections>
            <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
        </configSections>
    </configuration>
    

    add to your app.config file

    0 讨论(0)
  • 2021-01-03 17:58

    Not sure why not post the whole example.

    <configuration>
      <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
      </configSections>
      ...
      <log4net>
        ...
      </log4net>
    </configuration>
    
    0 讨论(0)
  • 2021-01-03 18:11

    You need to declare the log4net section:

    <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    </configSections>
    

    Take a closer look at the documentation which explains the necessary things to do.

    0 讨论(0)
提交回复
热议问题