CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.microsoft_application_blocks Tags:
Item Type: NewsGroup Date Entered: 11/12/2003 6:00:17 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 46 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
icelava
Asp.Net User
XML config not loading as advertised11/12/2003 6:00:17 AM

0

Ok i've just started to look into just what good CMAB does, and I must say that's quite an awful lot of meta-configuration to get your configuration :)

Trying to get the bare minimum of a single value in an XML file just to see the whole thing in action, I have added into a test web project's Web.config
<configuration>

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

<applicationConfigurationManagement>
<configSection name="FirstAppSettings">
<configProvider
assembly="Microsoft.ApplicationBlocks.ConfigurationManagement,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileStorage"
path="D:\code\RemoteTest\CustomConfig.xml"
signed="false"
encrypted="false"
/>
</configSection>
</applicationConfigurationManagement>
First anomaly: notice the path of the <configProvider> element is hardcoded absolute file system path. If I simply put "CustomConfig.xml" as suggested in the doc I will be thrown Exception:

Can´t find the configuration file System.Xml.XmlDocument. You must check the 'path' attribute in the section 'FirstAppSettings'

The ~ app root doesn't work either.

Second, my CustomConfig.xml as per the doc simply has
<?xml version="1.0" encoding="utf-8" ?>

<configuration>
<FirstAppSettings>
<SomeItem>None</SomeItem>
</FirstAppSettings>
</configuration>
and my line of ConfigurationManager.Item["SomeItem"] will complain:

Can't deserialize the Hashtable.

Ok I'm quite lost what is playing up here..... clues please?
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
icelava
Asp.Net User
Re: XML config not loading as advertised11/12/2003 7:04:41 AM

0

Right it appears an earlier thread has the answer to the custom XML config file issue - a specific schema must be followed.

Does anybody know about the path setting?
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
icelava
Asp.Net User
Re: XML config not loading as advertised11/12/2003 11:01:07 AM

0

In trying to get to the root of the exception thrown upon finding a relative filename specified in the path attribute for the configProvider element, the error message consistently reports

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Can´t find the configuration file System.Xml.XmlDocument. You must check the 'path' attribute in the section 'CustomSettings'

Source Error:


[No relevant source lines]


Source File: none Line: 0

I compile a Debug build of the ConfigurationManagement project but it still doesn't reveal any source code for line hints. My other projects in the solution can report their line numbers when exceptions occur, just not CMAB. I wonder why so?
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
icelava
Asp.Net User
Re: XML config not loading as advertised11/12/2003 1:30:58 PM

0

I couldn't get it to reveal line code despite setting everything to debug. Luckily, i was still able to step/trace and managed to find the offending logic - the XmlFileStorage.Init() method.
// Around lines 69 - 75.

_applicationDocumentPath = configStorageParameters[ "path" ] as string;
if( _applicationDocumentPath == null )
_applicationDocumentPath = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
else
_applicationDocumentPath = Path.GetFullPath( _applicationDocumentPath );
If I merely put "custom.config" in the path attribute, _applicationDocumentPath won't be null, and it will become "C:\WINDOWS\SYSTEM32\custom.config" after using Path.GetFullPath() to it. I wonder what's the usefulness of Path.GetFullPath() here. Anyway adjusting to this check
if( _applicationDocumentPath == null )

_applicationDocumentPath = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
else if (!Path.IsPathRooted(_applicationDocumentPath))
{
_applicationDocumentPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + _applicationDocumentPath;
}
will then allow me to make it relative to the application root's directory. I believe this shall fix it.
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Bug 124643 – system-config-network-cmd does not work as advertised Last Comment -; Format For Printing; - XML; - Clone This Bug ... Bug 124643 - system-config-network-cmd does not work as advertised .... I did not try various possible ways of using system-config-network but _this_ seem to work. ...
PHP Bugs: #24162: some filesystem functions return bool, not int ... Bug #24162, some filesystem functions return bool, not int (as advertised) ... Compile Failure, Compile Warning, Configuration Issues, Dynamic loading ... int to bool: chgrp.xml chmod.xml chown.xml copy.xml link.xml mkdir.xml rewind.xml ...
2.1.7 not advertised in Caucho home page: msg#00060 text.xml.resin ... 2.1.7 not advertised in C - Find Help in our text.xml.resin.user Forum.
Chapter 6. The Service Registry Re: Port not advertised Subject, Re: Port not advertised. Date, Fri, 02 May 2008 05:15:28 GMT. Wayne Can you attach the WSDL and the synapse.xml you use? asankha Wayne ... Should I be specifying a Synapse > config option or is this potentially a Axis2 issue? ...













exe file...

custom exception and emab

output parameter

enterprise library for net 2.0 january 2006 question

raiserror() on store procedures

enterprise library configuration

version 2 - filldataset method bug

how to access the application cache from the timer event

encryption settings and key

asynchronous support in .net 2.0

difference between addinparameter and sqlparameter

getcurrenttask method

disposing the database object

dbcommandwrapper for enterprise library 2006

sqlhelper.executereader

listing all objects in cache?

the value of the property 'type' cannot be parsed.

enterprise library caching and sql dependencies

enterprise library for .net framework 2.0 security problem.

xsl transformation using daab not working

adding entlib 2.0 to a solution, what would be the best practice?

error publishing to the event log

inaccessible logs: security.

aggregation block - number of improvements

sign dll

can't resolve how logging quickstart defines a icollection var

is numeric type validator - vab?

the specified type is abstract

membership features or application blocks 2.0

error trying to use daab in vb.net class

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT