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

Closed Issue: Error while using NLog under mono [6462]

$
0
0
<p>Hi,</p>
<p>I hope that I did not created twice.</p>
<p>&nbsp;</p>
<p>I want to use mono and NLog under OpenSuse.</p>
<p>&nbsp;</p>
<p>First I have created a litle consol application to test NLog.</p>
<p>&nbsp;</p>
<p> class Program</p>
<p> {</p>
<p> private static Logger logger = LogManager.GetCurrentClassLogger();</p>
<p>&nbsp;</p>
<p> static void Main(string[] args)</p>
<p> {</p>
<p> logger.Debug(&quot;Test&quot;);</p>
<p> }</p>
<p> }</p>
<p>&nbsp;</p>
<p>NLog_config file:</p>
<p>&nbsp;</p>
<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;</p>
<p>&lt;nlog xmlns=&quot;http://www.nlog-project.org/schemas/NLog.xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</p>
<p> internalLogFile=&quot;/media/log/Nlog_error.log&quot;</p>
<p> internalLogLevel=&quot;Trace&quot;</p>
<p> autoReload=&quot;true&quot;&gt;</p>
<p> &lt;targets&gt;</p>
<p> &lt;target name=&quot;OtherLog&quot; xsi:type=&quot;File&quot; fileName=&quot;/media/log/Other.log&quot; /&gt;</p>
<p> &lt;/targets&gt;</p>
<p> &lt;rules&gt;</p>
<p> &lt;logger name=&quot;*&quot; minlevel=&quot;Trace&quot; writeTo=&quot;OtherLog&quot; /&gt;</p>
<p> &lt;/rules&gt;</p>
<p>&lt;/nlog&gt;</p>
<p>&nbsp;</p>
<p>RESULT:</p>
<p>&nbsp;</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.ServiceModel.ServiceContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000428</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.ServiceModel.ServiceContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000428</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.ServiceModel.ServiceContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000428</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.ServiceModel.ServiceContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000428</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.ServiceModel.ServiceContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000428</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.ServiceModel.ServiceContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000428</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.Runtime.Serialization.DataContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a00042a</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.Runtime.Serialization.DataContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a00042a</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.Runtime.Serialization.CollectionDataContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000434</p>
<p>Missing method .ctor in assembly /media/Debug/NLog.dll, type System.ServiceModel.ServiceContractAttribute</p>
<p>Can&#39;t find custom attr constructor image: /media/Debug/NLog.dll mtoken: 0x0a000428</p>
<p>&nbsp;</p>
<p>Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for TestNlog.Program ---&gt; NLog.NLogConfigurationException: Exception occurred when loading configuration from /media/Debug/NLog.config ---&gt; System.ArgumentException: Target cannot be found: &#39;File&#39;</p>
<p> at NLog.Config.Factory`2[NLog.Targets.Target,NLog.Targets.TargetAttribute].CreateInstance (System.String name) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.Config.XmlLoggingConfiguration.ParseTargetsElement (NLog.Config.NLogXmlElement targetsElement) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.Config.XmlLoggingConfiguration.ParseNLogElement (NLog.Config.NLogXmlElement nlogElement, System.String baseDirectory) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.Config.XmlLoggingConfiguration.ParseTopLevel (NLog.Config.NLogXmlElement content, System.String baseDirectory) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.Config.XmlLoggingConfiguration.Initialize (System.Xml.XmlReader reader, System.String fileName, Boolean ignoreErrors) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> --- End of inner exception stack trace ---</p>
<p> at NLog.Config.XmlLoggingConfiguration.Initialize (System.Xml.XmlReader reader, System.String fileName, Boolean ignoreErrors) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.Config.XmlLoggingConfiguration..ctor (System.String fileName) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.LogFactory.get_Configuration () [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.LogFactory.GetLogger (NLog.LoggerCacheKey cacheKey) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.LogFactory.GetLogger (System.String name) [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at NLog.LogManager.GetCurrentClassLogger () [0x00000] in &lt;filename unknown&gt;:0</p>
<p> at TestNlog.Program..cctor () [0x00000] in &lt;filename unknown&gt;:0</p>
<p> --- End of inner exception stack trace ---</p>
<p>&nbsp;</p>
<p>The same application works under mono 2.8 event if it never finish.</p>
<p>&nbsp;</p>
<p>Could you help me please.</p>

Comments:

See comment


Viewing all articles
Browse latest Browse all 60

Trending Articles



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