log4net not creating log file upon installation
<p>I have searched far and wide for my solution (including relevant stackoverflow questions) but have yet to find an answer that fixes my issue.  I have been using log4net successfully in a work project and when I run the program in visual studio I get my log file.  If I install the program using the msi installer (wix) then I do NOT get a log file.  I'll first list things I've tried, followed by an edited version of my code.</p>

<p>Also, anywhere I say "appname" I did not actually put appname, just keeping project name out of post.</p>

<ol>
<li><p>I'm placing the log file in ${USERPROFILE}\AppData\Local[appname] directory, permissions are not an issue.</p></li>
<li><p>Since the config file that is present in the installed version is appname.exe.config instead of app.config, I changed the Assemblyinfo.cs assembly statement to appname.exe.config.  This however did not solve my issue, it still only works while running through visual studio, an installed version does not.</p></li>
<li><p>I have modified product.wxs to deliver log4net.dll and log4net.xml to the install directory. (forgot to do this, app would not start so came back and added it in) still no change.</p></li>
</ol>

<p>We have 5 projects within a single solution using log4net. all of the assemblyinfo.cs files have the following:</p>

<p><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = "appname.exe.config", Watch = true)]</code></p>

<p>I was using <code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = "app.config", Watch = true)]</code> but changed this to the modified config file name that is placed in the install dir and the bin.</p>

<p>Inside of app.config(excuse any possible typos, my dev machine is airgapped and I cannot copy paste the code):</p>

<pre><code>&lt;configuration&gt;
    &lt;configSections&gt;
        &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/&gt;
    &lt;/configSections&gt;
    &lt;log4net&gt;
        &lt;root&gt;
            &lt;level value="ALL"/&gt;
            &lt;appender-ref ref="MyAppender"/&gt;
        &lt;/root&gt;
        &lt;appender name="MyAppender" type="log4net.Appender.FileAppender"&gt;
            &lt;file value="${USERPROFILE}\AppData\Local\appname\appname.log"/&gt;
            &lt;appendToFile value="true"/&gt;
            &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock"/&gt;
            &lt;layout type="log4net.Layout.PatternLayout"&gt;
                &lt;conversionPattern value="%date %level - %message%newline"/&gt;
            &lt;/layout&gt;
        &lt;/appender&gt;
    &lt;/log4net&gt;
&lt;/configuration&gt;
</code></pre>

<p>and in my c# code where I use the logger:</p>

<pre><code>private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
</code></pre>