S
Shannon Richards
Hello All: I have implemented a custom configuration section in my
app.config file as follows:
<configSections>
<section name="AdminUIConfig"
type="TestMgr.UIConfigSection,TestMgr"/>
</configSections>
<AdminUIConfig name="Admin" caption="Administrator"
captionLC="administrator">
<lookupLayouts>
<lookupLayout name="c1" caption="Administrator" imageIndex="0"
property="FullName" />
<lookupLayout name="c2" caption="Email Address"
property="EmailAddress" />
<lookupLayout name="c3" caption="Insert By" property="InsertBy" />
<lookupLayout name="c4" caption="Insert Date" property="InsertDate"
/>
<lookupLayout name="c5" caption="Update By" property="UpdateBy" />
<lookupLayout name="c6" caption="Update Date" property="UpdateDate"
/>
</lookupLayouts>
</AdminUIConfig>
I can read the configuration properties from my custom section without
issue. When I modify one of the properties in this section programmatically
and save the configuration file nothing seems to happen? The configuration
remains changed while the application is open but when the application
restarts the changes I saved are not available?
I modify and save a property for my custom section as follows:
Dim c As Configuration
Dim s As UIConfigSection
c =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
s = c.GetSection("AdminUIConfig")
s.captionLC = "MODIFIED!"
s.SectionInformation.ForceSave = True
c.Save(ConfigurationSaveMode.Modified)
AM I MISSING SOMETHING?
Thank you,
Shannon Richards
BBA, AIT, MCP
app.config file as follows:
<configSections>
<section name="AdminUIConfig"
type="TestMgr.UIConfigSection,TestMgr"/>
</configSections>
<AdminUIConfig name="Admin" caption="Administrator"
captionLC="administrator">
<lookupLayouts>
<lookupLayout name="c1" caption="Administrator" imageIndex="0"
property="FullName" />
<lookupLayout name="c2" caption="Email Address"
property="EmailAddress" />
<lookupLayout name="c3" caption="Insert By" property="InsertBy" />
<lookupLayout name="c4" caption="Insert Date" property="InsertDate"
/>
<lookupLayout name="c5" caption="Update By" property="UpdateBy" />
<lookupLayout name="c6" caption="Update Date" property="UpdateDate"
/>
</lookupLayouts>
</AdminUIConfig>
I can read the configuration properties from my custom section without
issue. When I modify one of the properties in this section programmatically
and save the configuration file nothing seems to happen? The configuration
remains changed while the application is open but when the application
restarts the changes I saved are not available?
I modify and save a property for my custom section as follows:
Dim c As Configuration
Dim s As UIConfigSection
c =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
s = c.GetSection("AdminUIConfig")
s.captionLC = "MODIFIED!"
s.SectionInformation.ForceSave = True
c.Save(ConfigurationSaveMode.Modified)
AM I MISSING SOMETHING?
Thank you,
Shannon Richards
BBA, AIT, MCP