c# - Common.Logging config exception -
i'm getting following exception when try call
var log = logmanager.getlogger(this.gettype());
a first chance exception of type 'common.logging.configurationexception' occurred in common.logging.dll
an unhanded exception of type 'common.logging.configurationexception' occurred in common.logging.dll
additional information: failed obtaining configuration common.logging configuration section 'common/logging'.
this .net 4 application references
- log4net.dll
- common.logging.dll
- common.logging.log4net.dll
my app.config has following:
<?xml version="1.0"?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.0"/> </startup> <configsections> <sectiongroup name="common"> <section name="logging" type="common.logging.configurationsectionhandler, common.logging" /> </sectiongroup> </configsections> <common> <logging> <factoryadapter type="common.logging.simple.consoleoutloggerfactoryadapter, common.logging"> <arg key="level" value="all" /> <arg key="showlogname" value="true" /> <arg key="showdatatime" value="true" /> <arg key="datetimeformat" value="yyyy/mm/dd hh:mm:ss:fff" /> </factoryadapter> </logging> </common> </configuration>
i'm trying call so:
var log = logmanager.getlogger(this.gettype()); log.debug(m => m("testing"));
what missing?
it runs ok if remove element startup
config.
edit: instead of removing, move startup element after configsections.
Comments
Post a Comment