Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was having the same problem as you:</p> <ul> <li>ASP.NET MVC 3</li> <li>.NET 4</li> <li>IIS 7</li> <li>Release Mode</li> </ul> <p>I tried changing directories, and changing permissions to no avail. I even tried enabling the internal logging but even that didn't work! No failures, no exceptions, nothing!</p> <p>After doing some more investigating, I found the solution. <strong>For some reason, NLog wasn't loading the config file AT ALL.</strong> I realized this after I programmatically enabled the internal logging. The internal logging reported this:</p> <pre><code>2012-02-13 11:34:40.3181 Debug Targets for MyMvcController by level: 2012-02-13 11:34:40.3181 Debug Trace =&gt; 2012-02-13 11:34:40.3181 Debug Debug =&gt; 2012-02-13 11:34:40.3181 Debug Info =&gt; 2012-02-13 11:34:40.3181 Debug Warn =&gt; 2012-02-13 11:34:40.3181 Debug Error =&gt; 2012-02-13 11:34:40.3181 Debug Fatal =&gt; </code></pre> <p>This was basically saying that there were no targets defined for any of the log levels! Definitely not correct!</p> <p>My NLog configuration file was as simple as it could be(and it was set to Copy to Output Directory):</p> <pre><code>&lt;nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" throwExceptions="true"&gt; &lt;targets&gt; &lt;target name="file" xsi:type="File" fileName="${basedir}/MyApplication.log" /&gt; &lt;/targets&gt; &lt;rules&gt; &lt;logger name="*" minlevel="Trace" writeTo="file" /&gt; &lt;/rules&gt; &lt;/nlog&gt; </code></pre> <p>I'm still not sure exactly <strong>why</strong> this was happening, but moving the NLog configuration into the web.config directly resolved the problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload