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 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>
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>
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>
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>
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);
THANKYOU Allen! Everything runs fine now :) I really appreciate your time.
Lee This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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?...
|
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...
|
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...
|
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...
|
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'.
...
|
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...
|
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 '/'...
|
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....
|
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
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |