Problem:
Using Log4net to output logs.
After the configure file is ready, we will add its reference to Project's AssemblyInfo.cs like this:
Log4net.Configure.XMLConfigure( Configure = File, Watch = True);
Then, Initial a logger by Log4Net.ILog.
If all are ready, we can use it for logging.
But, after i change Configre File's name and reset the info in Assembly.cs, log cannot be write again.
I have try many times, even simple the code and info in configuration.
None of them works.
Finally, the "Dynamic Watch" Help it.
Solution:
Abandon original watching approach. Do like this:
Add code before Logger instantiate:
FileInfo configureFileinfo = new Fileinfo( string fullpath of ConfigureFile);
Log4net.Config.XmlConfigurator.ConfigureAndWatch( configureFileinfo );