I am trying to use the Application blocks configuration manager. I am
reading the docs on how to setup the app.config file to use the proper
reader/writer. I want to use xml file. I followed the directions and I am
still getting an error in the app.config file, it's complaining about
"Unrecognized configuration section", "applicationConfigurationManagement".
Here is the app.config file declaration as the docs say:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<applicationConfigurationManagement defaultSection="TestConfigSection">
<configSection name="TestConfigSection">
<configProvider
assembly="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFil
eStorage" path="C:\\Documents and Settings\\Lee Connell\\My
Documents\\Visual Studio Projects\\ConfigTest\\ConfigTest.xml"
refreshOnChange="true" signed="false" encrypted="false"/>
</configSection>
</applicationConfigurationManagement>
</configuration>
What am I missing to use this correctly?
Thank you
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="applicationConfigurationManagement"
type="System.Configuration.NameValueSectionHandler,System.Configuration,Vers
ion=1.0.0.0,Culture=neutral,PublicKeyToken=null"/>
</configSections>
I cant see the rest of the thread, so I dont have a clue what problem you
are seeing. But from the look of the XML config file you have shown, your
<configProvider> element is missing a "type" attribute, which tells CMAB the
name of the provider class.
Try:
type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileSto
rage"
Also not sure if you need the "\\" in your path attribute or just "\" - cant
remember.
Regards
Allen
"Lee Connell" <leeco...@adelphia.net> wrote in message
news:OJd7OjrT...@tk2msftngp13.phx.gbl...
I sent you an email also, I don't know what you can't see?
Here is the config file I've been trying to get to work.
This is the "App.Config" file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section
name="applicationConfigurationManagement"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.ConfigurationManag
erSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=null"/>
</configSections>
<applicationConfigurationManagement defaultSection="TestConfigSection">
<configSection name="TestConfigSection">
<configProvider
assembly="Microsoft.ApplicationBlocks.ConfigurationManagement,Version=1.0.0.
0,Culture=neutral,PublicKeyToken=null"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileSto
rage"
path="C:\\Documents and Settings\\Lee Connell\\My Documents\\Visual Studio
Projects\\ConfigTest\\ConfigTest.xml"
refreshOnChange="true"
signed="false"
encrypted="false"/>
</configSection>
</applicationConfigurationManagement>
</configuration>
Here is the "ConfigTest.xml" file I want to use to read and write values to:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<TestConfigSection>
</TestConfigSection>
</configuration>
Regards
Allen
"Lee Connell" <leeco...@adelphia.net> wrote in message
news:ukafq4uT...@TK2MSFTNGP12.phx.gbl...
Additional information: Section 'TestConfigSection' not defined on the
configuration file. Check the /configuration/configSections/section node in
the application config file (assemblyfilename.config). This node must be
like <section name="XmlConfig" type="WinApp.CustomSectionHandler,WinApp" />.
using this code:
ConfigurationManager.Initialize();
tbl = new Hashtable();
tbl.Add("testkey", "testvalue");
ConfigurationManager.Write(tbl);
Add a <section> element for the TestConfigSection to the <configSections>
element of your application's config file, so it should look like this.
<configSections>
<section name="applicationConfigurationManagement"
type="System.Configuration.NameValueSectionHandler,System.Configuration,Vers
ion=1.0.0.0,Culture=neutral,PublicKeyToken=null"/>
<section name="TestConfigSection"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.XmlHashtableSectio
nHandler,Microsoft.ApplicationBlocks.ConfigurationManagement,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />
</configSections>
Regards
Allen
"Lee Connell" <leeco...@adelphia.net> wrote in message
news:%23r1y7Gv...@TK2MSFTNGP12.phx.gbl...
Lee