Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when logs an Error with exception #35

Closed
imasm opened this issue May 24, 2017 · 3 comments
Closed

Crashes when logs an Error with exception #35

imasm opened this issue May 24, 2017 · 3 comments
Labels

Comments

@imasm
Copy link

imasm commented May 24, 2017

Hi

With RichTextBoxTarget the applicatin crashes when I try to log an Error with exception argument.

if (Logger.IsErrorEnabled)
                Logger.Error("This is a message", new Exception("simple exception"));

System.MissingMethodException

'Method not found: 'Void NLog.ILogger.Error(System.Exception, System.String)'.'

This is my nlog.config

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  
  <targets>
      <target name="richTextBox" xsi:type="RichTextBox"
            layout="${time} : ${message}"
            formName="MainForm"
            ControlName="LogViewer"
            autoScroll="true"
            maxLines="20"
            useDefaultRowColoringRules="true"
            allowAccessoryFormCreation="false" />
  </targets>

  <rules>
    <logger name="*" minlevel="Info"  writeTo="richTextBox" />
  </rules>
</nlog>
@304NotModified
Copy link
Member

Could you double check the NLog version where it's deployed? (properties of nlog.dll). It looks like there is an older version there

@imasm
Copy link
Author

imasm commented May 24, 2017

Yes!!

I had NLog 4.0.0, after update to 4.4.9 the code runs well.

Thank you very much for your time. I apologize for the inconvenience.

@imasm imasm closed this as completed May 24, 2017
@304NotModified
Copy link
Member

Glad it has been resolved! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants