Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Application Blocks (XML File) Configuration Manager

32 views
Skip to first unread message

Lee Connell

unread,
Jul 20, 2003, 1:09:25 AM7/20/03
to
Hello,

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


Lee Connell

unread,
Jul 20, 2003, 8:16:27 AM7/20/03
to
I have tried the following also. I am pretty aggrivated right now because I
don't believe it is clear enough on how to set this. It could also be my
lack of xml xsd knowledge.

<?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>

Allen Jones

unread,
Jul 20, 2003, 9:34:47 AM7/20/03
to
Sorry Lee,

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...

Lee Connell

unread,
Jul 20, 2003, 2:38:49 PM7/20/03
to
Hi Allen,

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>


Allen Jones

unread,
Jul 20, 2003, 2:54:42 PM7/20/03
to
And what is happening when you try to use these files?

Regards
Allen

"Lee Connell" <leeco...@adelphia.net> wrote in message

news:ukafq4uT...@TK2MSFTNGP12.phx.gbl...

Lee Connell

unread,
Jul 20, 2003, 3:04:21 PM7/20/03
to
Initialize() works fine but when i try to add something to the file I get
this error:

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);


Allen Jones

unread,
Jul 20, 2003, 3:49:04 PM7/20/03
to
Lee,

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 Connell

unread,
Jul 20, 2003, 4:34:00 PM7/20/03
to
THANKYOU Allen! Everything runs fine now :) I really appreciate your time.

Lee


0 new messages