title: Log4Net not working, but only for release console builds
body: <p>I've got an assembly in which I use log4net.  I load this assembly into both Windows forms applications and console applications.  It works as expected in Windows forms apps in both release and debug builds, and console apps in debug builds, but mysteriously fails for release builds of console apps.</p>
  
  <p>I have the following in my AssemblyInfo.cs file:</p>
  
  <pre><code>[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension="log4net", Watch = true)]
  </code></pre>
  
  <p>In classes that use logging I include the following member variable declaration:</p>
  
  <pre><code>private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  </code></pre>
  
  <p>And my Library.dll.log4net configuration file looks as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;log4net&gt;
    &lt;appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" &gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;conversionPattern value="%date [%thread] %-5level %logger - %message%newline" /&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;
    &lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender" &gt;
      &lt;file value="Library.log" /&gt;
      &lt;appendToFile value="true" /&gt;
      &lt;rollingStyle value="Once" /&gt;
      &lt;maxSizeRollBackups value="5" /&gt;
      &lt;staticLogFileName value="true" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;conversionPattern value="%date [%thread] %-5level %logger - %message%newline" /&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;
    &lt;root&gt;
      &lt;level value="INFO" /&gt;
      &lt;appender-ref ref="ConsoleAppender" /&gt;
      &lt;appender-ref ref="RollingFileAppender" /&gt;
    &lt;/root&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>I've tried the suggestions in <a href="https://stackoverflow.com/questions/22490447/log4net-doesn-t-write-log-in-release-mode-console-application">this article</a> (<a href="https://stackoverflow.com/questions/22490447/log4net-doesn-t-write-log-in-release-mode-console-application">Log4Net doesn’t write log in release mode - Console Application</a>) but they don't seem to help.</p>
  
  <p>I've also tried programmatically turning on internal debugging as soon as possible in the assembly (in the constructor of the first object referenced) but that also has no effect.</p>
  
  <p>Any other ideas?  Can anyone spot what I'm doing wrong?</p>