[Mono-bugs] [Bug 498853] New: Cannot configure ConsoleTraceListener to use standard error through configuration

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Apr 28 10:17:00 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=498853


           Summary: Cannot configure ConsoleTraceListener to use standard
                    error through configuration
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Other
        OS/Version: RHEL 4
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dwayne at zeroc.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Description of Problem:

You cannot configure the ConsoleTraceListener to use standard error though
configuration file. It should be possible to do this with a config file like
the following

<configuration>
  <system.diagnostics>
    <trace autoflush="false" indentsize="4">
      <listeners>
        <add name="Console"
          type="System.Diagnostics.ConsoleTraceListener"
          initializeData="true"/>
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

where initializeData="true" indicates to use standard error. This works fine
with Microsoft .NET.


Steps to reproduce the problem:
1. Create simple program that just use System.Diagnostic.Trace
2. Compile making sure to enable trace (or add defined TRACE to program)
3. Create config file for exe with above content
4. Run program


Actual Results:

Unhandled Exception: System.Configuration.ConfigurationException: Couldn't find
constructor for class System.Diagnostics.ConsoleTraceListener
  at System.Diagnostics.DiagnosticsConfigurationHandler.AddTraceListener
(IDictionary d, System.Xml.XmlNode child, System.Xml.XmlAttributeCollection
attributes, System.Diagnostics.TraceListenerCollection listeners) [0x00000] 
  at System.Diagnostics.DiagnosticsConfigurationHandler.AddTraceListeners
(IDictionary d, System.Xml.XmlNode listenersNode,
System.Diagnostics.TraceListenerCollection listeners) [0x00000] 
  at System.Diagnostics.DiagnosticsConfigurationHandler.AddTraceNode
(IDictionary d, System.Xml.XmlNode node) [0x00000] 
  at System.Diagnostics.DiagnosticsConfigurationHandler.Create (System.Object
parent, System.Object configContext, System.Xml.XmlNode section) [0x00000] 
  at System.Configuration.ConfigurationSection.GetRuntimeObject () [0x00000] 
  at
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection
(System.String configKey) [0x00000] 
  at System.Configuration.ConfigurationManager.GetSection (System.String
sectionName) [0x00000] 
  at System.Configuration.ConfigurationSettings.GetConfig (System.String
sectionName) [0x00000] 
  at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x00000] 
  at System.Diagnostics.TraceImpl.InitOnce () [0x00000] 
  at System.Diagnostics.TraceImpl.get_Listeners () [0x00000] 
  at System.Diagnostics.TraceImpl.get_ListenersSyncRoot () [0x00000] 
  at System.Diagnostics.TraceImpl.WriteLine (System.String message) [0x00000] 
  at System.Diagnostics.Trace.WriteLine (System.String message) [0x00000] 
  at Test.Main (System.String[] args) [0x00000] 


Expected Results:

Program should print Trace output to standard error


How often does this happen? 

Always


Additional Information:

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list