Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-420

Destructor of class called upon invoking XmlConfigurator.Configure

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.2.10, 1.2.13
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Linux (openSuse 12.2 i586), Mono 2.10.9

      Description

      If I run XmlConfigurator.Configure on an XML File after an instance of some class has been created, the destructor of that class is called for some reason. Here is my test code:

      using System;

      public class Test
      {

      ~Test()

      { Console.WriteLine("Test object finalized."); }

      }

      public static class M
      {
      public static void Main()

      { Console.WriteLine("Start"); Test test = new Test(); Console.WriteLine("configuring"); log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("LogConfiguration.xml")); Console.WriteLine("End"); }

      }

      Running this yields the output:

      Start
      configuring
      Test object finalized.
      End

      I'm not really sure, if this is a bug in log4net or in mono

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              argemat Mat Arge
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: