Quantcast
Channel: NLog - Advanced .NET Logging
Viewing all articles
Browse latest Browse all 60

Closed Issue: configuration file at location of nlog.dll is not found [6081]

$
0
0
<p>According to its specification, NLog should try to read a configuration file at the location of NLog.dll. This does not work for me.</p>
<p>&nbsp;</p>
<p>Examining the code I found that in LogFactory the lines</p>
<p>&nbsp;</p>
<p> // get path to NLog.dll.nlog only if the assembly is not in the GAC</p>
<p> var nlogAssembly = typeof(LogFactory).Assembly;</p>
<p> if (!nlogAssembly.GlobalAssemblyCache)</p>
<p> {</p>
<p> yield return nlogAssembly.GetName().CodeBase + &quot;.nlog&quot;;</p>
<p> }</p>
<p>&nbsp;</p>
<p>yield &quot;file:///NLog.dll.nlog&quot;</p>
<p>&nbsp;</p>
<p>Cutting the &quot;file:///&quot; part</p>
<p>&nbsp;</p>
<p> {</p>
<p> yield return nlogAssembly.GetName().CodeBase.Replace(&quot;file:///&quot;, &quot;&quot;) + &quot;.nlog&quot;;</p>
<p> }</p>
<p>&nbsp;</p>
<p>makes it work.</p>

Comments:

Moved to https://github.com/NLog/NLog/issues/142


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>