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 .Applicati onSettings Group, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089" >
<section name="DLLLoadTest.Properti es.Setting s" type="System.Configuration .ClientSet tingsSecti on, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089" requirePermission="false" />
</sectionGroup>
</configSections>
<!-- Configuration section-handler declaration area. -->
<configSections>
<sectionGroup name="serverControlGroup">
<section
name ="serverControl"
type = "ADMultiDomain.ServerContr olSections "
allowLocation = "true"
allowDefinition = "Everywhere"
/>
</sectionGroup>
</configSections>
<!-- Configuration section-handler declaration area -->
<serverControlGroup>
<serverControl controlKey = "1" controlName = "MurachWebControlLibrary.d ll" description = "Server Control Test"
location = "C:\LOCAL_DEVELOPMENT\Mura chWebContr olLibrary\ MurachWebC ontrolLibr ary\obj\De bug\"
method = "DaysUntilDate" />
</serverControlGroup>
<applicationSettings>
<DLLLoadTest.Properties.Se ttings>
<setting name="General" serializeAs="String">
<value>"No value, used to generate app.config in proper format"</value>
</setting>
</DLLLoadTest.Properties.S ettings>
</applicationSettings>
</configuration>
And I am using the following to intialize my class to read from the app.config:
DLLLoadTest.ServerControlS ections config =
(DLLLoadTest.ServerControl Sections)S ystem.Conf iguration. Configurat ionManager .GetSectio n("serverC ontrolGrou p/serverCo ntrol");
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.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings"
<section name="DLLLoadTest.Properti
</sectionGroup>
</configSections>
<!-- Configuration section-handler declaration area. -->
<configSections>
<sectionGroup name="serverControlGroup">
<section
name ="serverControl"
type = "ADMultiDomain.ServerContr
allowLocation = "true"
allowDefinition = "Everywhere"
/>
</sectionGroup>
</configSections>
<!-- Configuration section-handler declaration area -->
<serverControlGroup>
<serverControl controlKey = "1" controlName = "MurachWebControlLibrary.d
location = "C:\LOCAL_DEVELOPMENT\Mura
method = "DaysUntilDate" />
</serverControlGroup>
<applicationSettings>
<DLLLoadTest.Properties.Se
<setting name="General" serializeAs="String">
<value>"No value, used to generate app.config in proper format"</value>
</setting>
</DLLLoadTest.Properties.S
</applicationSettings>
</configuration>
And I am using the following to intialize my class to read from the app.config:
DLLLoadTest.ServerControlS
(DLLLoadTest.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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
ASKER