简体   繁体   中英

Log4net XmlConfigurator Configure issue

I am trying to set the location of my log4net.config file programmaticly in my C# project, using .net 4.0 and v1.2.11 of log4net, like it is defined here . It looks straight forward enough but whenever I try to use the XmlConfigurator.Configure methid I get the following error:

Error 4 'log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository, System.IO.Stream)' is a 'method' but is used like a 'type'

This is the line of code that is causing the problem:

XmlConfigurator.Configure(new System.IO.FileInfo(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\LocatorConfig.xml"));

Any help with this would be appreciated. Anto

我仍然不知道是什么原因导致这个问题,它仍然只发生在这一类,但加入了类似的包装建议在这个职位已经帮助我的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM