possible bug

Nov 4, 2011 at 3:10 PM

I've been fighting an error for quite some time (and as I've seen in the forums I'm not the first one).

This was the error: An error occurred creating the configuration section handler for FooSection

 

Anyway, I will explain the bug. I'm using namespace ClassLibrary1.Config to create everything. So the generated XML section tag looks like this:

<configSections>
    <section name="cL1Section" type="ClassLibrary1.Config.cL1Section, ClassLibrary1.Config"
             allowLocation="true"
            allowDefinition="Everywhere"/>
  </configSections>

This fails on runtime. After removing .Config, in other words, changing from namespace to assembly name, it works.

<configSections>
    <section name="cL1Section" type="ClassLibrary1.Config.cL1Section, ClassLibrary1"
             allowLocation="true"
            allowDefinition="Everywhere"/>
  </configSections>
I assume this is a bug, right?

Nov 8, 2011 at 1:06 PM

I concur with this - if you create your configuration in a namespace nested within a project it assumes the namesapce is the assembly name. No big deal as it's easy to spot and fix but I imagine someone could stare at the issue for hours until they see the cause.