Bug 8536 - System.Configuration.IgnoreSectionHandler causes sections to be ignored
Summary: System.Configuration.IgnoreSectionHandler causes sections to be ignored
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-21 04:44 UTC by Llewellyn Pritchard
Modified: 2012-11-21 06:52 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 8536 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Llewellyn Pritchard 2012-11-21 04:44:36 UTC
Hi

When using IgnoreSectionHandler (ie for log4net) any sections after the ignored section is also ignored.

The following works and the bindingRedirect is successful:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
  </configSections>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

  <log4net>
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="ConsoleAppender" />
    </root>
  </log4net>
</configuration>

When changing it to have the runtime section after log4net, it is simply ignored and bindingRedirect fails:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
  </configSections>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>

  <log4net>
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="ConsoleAppender" />
    </root>
  </log4net>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

</configuration>

Running Mono 3.0.1 compiled from source on Ubuntu 11.04 amd64.

I tried to debug the issue, but gdb explodes seemingly when reading the .config (whether it contains log4net or not).

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7221720 in memcpy () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) c
Continuing.
Stacktrace:

  at <unknown> <0xffffffff>
  at System.Xml.XmlInputStream.Initialize (System.IO.Stream) [0x001cc] in /home/agentx/mono-3.0.1/mcs/class/System.XML/System.Xml/XmlInputStream.cs:438
  at System.Xml.XmlInputStream..ctor (System.IO.Stream) [0x00006] in /home/agentx/mono-3.0.1/mcs/class/System.XML/System.Xml/XmlInputStream.cs:354
  at (wrapper remoting-invoke-with-check) System.Xml.XmlInputStream..ctor (System.IO.Stream) <IL 0x00020, 0xffffffff>
  at System.Xml.XmlStreamReader..ctor (System.IO.Stream) [0x00000] in /home/agentx/mono-3.0.1/mcs/class/System.XML/System.Xml/XmlInputStream.cs:50
  at (wrapper remoting-invoke-with-check) System.Xml.XmlStreamReader..ctor (System.IO.Stream) <IL 0x00020, 0xffffffff>
  at System.Xml.XmlTextReader..ctor (System.IO.Stream) [0x00000] in /home/agentx/mono-3.0.1/mcs/class/System.XML/System.Xml/XmlTextReader2.cs:71
  at ConfigXmlTextReader..ctor (System.IO.Stream,string) [0x00000] in /home/agentx/mono-3.0.1/mcs/class/System.Configuration/System.Configuration/ConfigXmlTextReader.cs:40
  at System.Configuration.Configuration.Load () [0x00045] in /home/agentx/mono-3.0.1/mcs/class/System.Configuration/System.Configuration/Configuration.cs:492
  at System.Configuration.Configuration.Init (System.Configuration.Internal.IConfigSystem,string,System.Configuration.Configuration) [0x00065] in /home/agentx/mono-3.0.1/mcs/class/System.Configuration/System.Configuration/Configuration.cs:137
...

Cheers

Llewellyn
Comment 1 Zoltan Varga 2012-11-21 06:52:00 UTC
-> System.Configuration.