473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Application Blocks (XML File) Configuration Manager

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.Configuratio nManagement.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
Nov 15 '05 #1
6 9827
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>
<applicationConfigurationManagement defaultSection="TestConfigSection">

<configSection name="TestConfigSection">

<configProvider
assembly="Microsoft.ApplicationBlocks.Configuratio nManagement.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>
Nov 15 '05 #2
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.ConfigurationMan agement.Storage.XmlFileSto
rage"

Also not sure if you need the "\\" in your path attribute or just "\" - cant
remember.

Regards
Allen
"Lee Connell" <le********@adelphia.net> wrote in message
news:OJ**************@tk2msftngp13.phx.gbl...
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>
<applicationConfigurationManagement defaultSection="TestConfigSection">

<configSection name="TestConfigSection">

<configProvider
assembly="Microsoft.ApplicationBlocks.Configuratio nManagement.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>

Nov 15 '05 #3
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.ConfigurationMan agement.ConfigurationManag
erSectionHandler,Microsoft.ApplicationBlocks.Confi gurationManagement,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=nul l"/>

</configSections>
<applicationConfigurationManagement defaultSection="TestConfigSection">

<configSection name="TestConfigSection">

<configProvider

assembly="Microsoft.ApplicationBlocks.Configuratio nManagement,Version=1.0.0.
0,Culture=neutral,PublicKeyToken=null"

type="Microsoft.ApplicationBlocks.ConfigurationMan agement.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>


Nov 15 '05 #4
And what is happening when you try to use these files?

Regards
Allen

"Lee Connell" <le********@adelphia.net> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
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.ConfigurationMan agement.ConfigurationManag erSectionHandler,Microsoft.ApplicationBlocks.Confi gurationManagement,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=nul l"/>

</configSections>
<applicationConfigurationManagement defaultSection="TestConfigSection">

<configSection name="TestConfigSection">

<configProvider

assembly="Microsoft.ApplicationBlocks.Configuratio nManagement,Version=1.0.0. 0,Culture=neutral,PublicKeyToken=null"

type="Microsoft.ApplicationBlocks.ConfigurationMan agement.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>

Nov 15 '05 #5
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.ConfigurationMan agement.XmlHashtableSectio
nHandler,Microsoft.ApplicationBlocks.Configuration Management,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=nul l" />

</configSections>

Regards
Allen
"Lee Connell" <le********@adelphia.net> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
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);

Nov 15 '05 #6
THANKYOU Allen! Everything runs fine now :) I really appreciate your time.

Lee
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex | last post by:
Hello, How can we create a custom TransformerProvider (deriving from XmlSerializerTransformer with some minor changes) and make it work with the Enterprise Library Configuration Application Block?...
4
by: grs | last post by:
Can a class library have a app.config file. Reason for asking is that the microsoft application blocks all read from myApp.exe.config. How can you use the application blocks if you do not have an...
5
by: PCC | last post by:
I am using the Exception Managment Application Block on Windows Server 2003 Enterprise and .NET v1.1. If I use the block with an ASP.NET web wervice or in a web application I get the following...
1
by: Jason | last post by:
Hi, I'm trying to integrate Microsoft's Configuration Management Application Block (CMAB), and have run into a bit of trouble. Would appreciate any input anybody could provide at this point. I...
3
by: Karuppasamy | last post by:
Hi I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net . I installed everything as per the Instructions given in the 'Development Using the Logging Block'. ...
0
by: Rhon Stewart via DotNetMonster.com | last post by:
Hi please visit this link : http://www.eggheadcafe.com/articles/pfc/selfupdater.asp I followed all the steps for listed on the link , when I execute the application it it gives me the following...
5
by: Matthew Louden | last post by:
I have no idea what this run-time error about. Any ideas? I already change the web.config file for the attribute <customErrors mode="Off"/> but still not work. Server Error in '/'...
1
by: Harold Howe | last post by:
When .NET loads an app.config at runtime (myapp.exe.config), will it honor an entity declaration? Based on what I am seeing, the answer is no, but I think, or hope, that I am doing something wrong....
3
by: John | last post by:
Hi Is there an easy way to allow user to change application settings at run time short of editing the configuration file manually? Thanks Regards
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.