Link to home
Start Free TrialLog in
Avatar of Hawkeye6352
Hawkeye6352

asked on

Configuration System Failed to Initialize

I have the following config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="DLLLoadTest.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
  <!-- Configuration section-handler declaration area. -->
  <configSections>
    <sectionGroup name="serverControlGroup">
      <section
        name ="serverControl"
        type = "ADMultiDomain.ServerControlSections"
        allowLocation = "true"
        allowDefinition = "Everywhere"
        />
    </sectionGroup>
  </configSections>
  <!-- Configuration section-handler declaration area -->
  <serverControlGroup>
    <serverControl controlKey = "1" controlName = "MurachWebControlLibrary.dll" description = "Server Control Test"
                   location = "C:\LOCAL_DEVELOPMENT\MurachWebControlLibrary\MurachWebControlLibrary\obj\Debug\"
                   method = "DaysUntilDate" />
  </serverControlGroup>

  <applicationSettings>
        <DLLLoadTest.Properties.Settings>
            <setting name="General" serializeAs="String">
                <value>"No value, used to generate app.config in proper format"</value>
            </setting>
        </DLLLoadTest.Properties.Settings>
    </applicationSettings>
</configuration>

And I am using the following to intialize my class to read from the app.config:

                DLLLoadTest.ServerControlSections config =
                    (DLLLoadTest.ServerControlSections)System.Configuration.ConfigurationManager.GetSection("serverControlGroup/serverControl");

And I get the following error, when this code tries to execute:

'Configuration System failed to initialize'

Any thoughts why.  I made sure that under the root I have configSections.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Hawkeye6352
Hawkeye6352

ASKER

Would that be causing the problem?  I will combine them and see what happens. Thanks.
I believe so. If you inspect the InnerException of the exception that is raised, it should give you an indication of what's going wrong.