Since I know the log4net, it has been used, has no problem, recently because of the project changes, the part of the code is separated, and then I call Loghelper in the UI project, I found in the local test everything is OK, but after publishing to the server is not normal. No error, but there is no log record. This problem has been tangled for hours, what permissions issues Ah, the version of the problem has been tried or not
It suddenly occurred to me that one of the changes in the project was to put the common class of log4net into another project, and then the UI project made the DLL call, but in fact the beginning of the question was also suspected, but the total feeling log4net belong to the physical resources, As long as the UI project reference log4net.config should be able to, so has always been considered to be other problems-alas, in fact, is in the dead, always take for granted!
So, I have referenced the Log4net.config in the class library that called Log4net, and also added [Assembly:log4net] to the AssemblyInfo.cs of the corresponding class library. Config.xmlconfigurator (configfile = "Log4net.config", configfileextension = "config", Watch = true)] This sentence, test, ok!
Before I recorded it, it occurred to me that if I deleted the Log4net.config file in my UI project, would it be a problem, then after the deletion, the test, ok!
Haha, in fact, it has been found here, Log4net.config file, as long as it exists in the class library directly called Log4net can, but the UI project AssemblyInfo.cs is still the same to add that sentence, otherwise it will fail