PC Review


Reply
 
 
=?Utf-8?B?S2V2aW4=?=
Guest
Posts: n/a
 
      3rd Aug 2004
Hi All,

I am desperately trying to use the CMAB, but I'm getting nowhere fast! I can't seem to find good enough documentation(I've read the docs that came with the CMAB).

This is what I want to do :

Have an external XML file that holds my values formatted something like the following :
<configuration>
<TestConfig>
<DataSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MyDocPath>C:\Documents and Settings\</MyDocPath>
</DataSettings>
</TestConfig>
</configuration>

I want to reference this file in my web.config/app.config as :

<configSections>
<section
name="applicationConfigurationManagement"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.ConfigurationManagerSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement, Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />

</configSections>

<applicationConfigurationManagement defaultSection="TestConfig">
<configSection name="TestConfig">

<configProvider
assembly="Microsoft.ApplicationBlocks.ConfigurationManagement,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileStorage"
path="c:\MyXML.xml"
refreshOnChange="true"
signed="false"
encrypted="false"/>
</configSection>

</applicationConfigurationManagement>
</configuration>

right, hopefully, so far so good - well this is what I've managed to pick up from the docs I've read. This is where I'm getting stuck. I want to take this external XML config file, and have it represented as an object called DataSettings(I've created a class that has the field types and names exactly like in the XML file. How do I get this data from the XML file, serialised/deserialized so that I can have the values avaliable in an object and then also write the new values back to the XML file? Do I need to create my own sectionhandler? and if so where do I begin doing that?

Thanks for any help

KeViN
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CMAB in class library using machine.config Mattias Microsoft Dot NET 0 27th Nov 2004 09:45 PM
CMAB in ClassLibrary using machine.config issue Mattias Microsoft Dot NET Framework 0 27th Nov 2004 08:55 PM
CMAB and standard section handlers R. Raghuraman Microsoft C# .NET 1 5th Mar 2004 09:34 AM
How to allow a null value in CMAB (Configuration Management Application Block) Rob Microsoft Dot NET 0 13th Jan 2004 07:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:42 PM.