473,406 Members | 2,769 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,406 software developers and data experts.

CMAB and standard section handlers

Hi,
Q1: Do the section handlers in .NET work with CMAB? The CMAB seems to
say so, but I am not sure.

Q2: I am having trouble using CMAB with the standard section handler -
I've been able to use CMAB with the HashtableSectionHandler. However,
when I try to replace this with DictionarySectionHandler, I get a null
reference exception:

See below for App.config file and the referenced config file.
Unhandled Exception: System.TypeInitializationException: The type
initializer for "LNUK.Framework.Co
mmon.DBWrapper" threw an exception. --->
System.NullReferenceException: Object reference not set to
an instance of an object.
at System.Configuration.HandlerBase.CheckForUnrecogni zedAttributes(XmlNode
node)
at System.Configuration.DictionarySectionHandler.Crea te(Object
parent, Object context, XmlNode se
ction)
at Microsoft.ApplicationBlocks.ConfigurationManagemen t.ConfigurationManager.Read(String
sectionNa
me) in C:\Program Files\Microsoft Application Blocks for
..NET\Configuration Management\Code\VB\Micro
soft.ApplicationBlocks.ConfigurationManagement\Con figurationManager.vb:line
164
at LNUK.Framework.Common.DBWrapper..cctor() in
C:\Raghu\Codebase\DatabaseWrapper\DatabaseWrapper\
DBWrapper.vb:line 149
--- End of inner exception stack trace ---
at LNUK.Framework.Common.DBWrapper..ctor()
at SimpleRun.main() in
C:\Raghu\Codebase\DatabaseWrapper\DBWrapperTests\S impleRun.vb:line 12

This is my app.config file

<configuration>
<configSections>
<section name="applicationConfigurationManagement"
type="Microsoft.ApplicationBlocks.ConfigurationMan agement.ConfigurationManagerSectionHandler,Microso ft.ApplicationBlocks.ConfigurationManagement,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=nul l" />
<section name="DBConfigSection"
type="System.Configuration.DictionarySectionHandle r,System,Version=1.0.5000.0,
Culture=neutral,PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="log4net.Config"
value="C:\Raghu\Codebase\DatabaseWrapper\log4net.c onfig"></add>

</appSettings>

<applicationConfigurationManagement defaultSection="DBConfigSection">
<configSection name="DBConfigSection">
<configProvider assembly="Microsoft.ApplicationBlocks.Configuratio nManagement,Version=1.0.0.0,Culture=neutral,Public KeyToken=null"
type="Microsoft.ApplicationBlocks.ConfigurationMan agement.Storage.XmlFileStorage"
path="..\..\Config\Database.config"
signed="false"
encrypted="false" />
</configSection>
</applicationConfigurationManagement>
</configuration>

This is my Database.config file referred above

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<DBConfigSection>
<add key="ConnectString" value="Persist Security
Info=False;Integrated
Security=SSPI;database=TestDB;server=LNGWOKD011876 ;Connect
Timeout=30"></add>
<add key="RetryCount" value="3"></add>
<add key="CommandTimeout" value="30"></add>
</DBConfigSection>
</configuration>
Nov 15 '05 #1
1 1916
It works but you need to tweak it a little bit.

Please see the following bug report:
http://www.gotdotnet.com/community/w...spx?bugid=9524
ra********@infosys.com (R. Raghuraman) wrote in message news:<a7**************************@posting.google. com>...
Hi,
Q1: Do the section handlers in .NET work with CMAB? The CMAB seems to
say so, but I am not sure.

Q2: I am having trouble using CMAB with the standard section handler -
I've been able to use CMAB with the HashtableSectionHandler. However,
when I try to replace this with DictionarySectionHandler, I get a null
reference exception:

See below for App.config file and the referenced config file.
Unhandled Exception: System.TypeInitializationException: The type
initializer for "LNUK.Framework.Co
mmon.DBWrapper" threw an exception. --->
System.NullReferenceException: Object reference not set to
an instance of an object.
at System.Configuration.HandlerBase.CheckForUnrecogni zedAttributes(XmlNode
node)
at System.Configuration.DictionarySectionHandler.Crea te(Object
parent, Object context, XmlNode se
ction)
at Microsoft.ApplicationBlocks.ConfigurationManagemen t.ConfigurationManager.Read(String
sectionNa
me) in C:\Program Files\Microsoft Application Blocks for
.NET\Configuration Management\Code\VB\Micro
soft.ApplicationBlocks.ConfigurationManagement\Con figurationManager.vb:line
164
at LNUK.Framework.Common.DBWrapper..cctor() in
C:\Raghu\Codebase\DatabaseWrapper\DatabaseWrapper\
DBWrapper.vb:line 149
--- End of inner exception stack trace ---
at LNUK.Framework.Common.DBWrapper..ctor()
at SimpleRun.main() in
C:\Raghu\Codebase\DatabaseWrapper\DBWrapperTests\S impleRun.vb:line 12

This is my app.config file

<configuration>
<configSections>
<section name="applicationConfigurationManagement"
type="Microsoft.ApplicationBlocks.ConfigurationMan agement.ConfigurationManagerSectionHandler,Microso ft.ApplicationBlocks.ConfigurationManagement,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=nul l" />
<section name="DBConfigSection"
type="System.Configuration.DictionarySectionHandle r,System,Version=1.0.5000.0,
Culture=neutral,PublicKeyToken=b77a5c561934e089" />
</configSections>
<appSettings>
<add key="log4net.Config"
value="C:\Raghu\Codebase\DatabaseWrapper\log4net.c onfig"></add>

</appSettings>

<applicationConfigurationManagement defaultSection="DBConfigSection">
<configSection name="DBConfigSection">
<configProvider assembly="Microsoft.ApplicationBlocks.Configuratio nManagement,Version=1.0.0.0,Culture=neutral,Public KeyToken=null"
type="Microsoft.ApplicationBlocks.ConfigurationMan agement.Storage.XmlFileStorage"
path="..\..\Config\Database.config"
signed="false"
encrypted="false" />
</configSection>
</applicationConfigurationManagement>
</configuration>

This is my Database.config file referred above

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<DBConfigSection>
<add key="ConnectString" value="Persist Security
Info=False;Integrated
Security=SSPI;database=TestDB;server=LNGWOKD011876 ;Connect
Timeout=30"></add>
<add key="RetryCount" value="3"></add>
<add key="CommandTimeout" value="30"></add>
</DBConfigSection>
</configuration>

Nov 15 '05 #2

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

Similar topics

0
by: Jill Graham | last post by:
Hi, I need a list of all the section names within a given sectionGroup defined in the web.config file. Is there a way to get this list using vb.net code ? Example : <configSections>...
0
by: Mattias | last post by:
Hi, I want to use the CMAB to retrieve configuration details for a class library. More particular, I'm developping a Data Access Layer in class libraries, with later on BL, allowing any...
6
by: Steve Jorgensen | last post by:
I tried to fix a problem for a client today in which report sections and even individual text controls in some of their reports are being split across page boundaries. Of course, I was thinking...
4
by: Nick Gilbert | last post by:
Hi, I would like the ability to store the configuration settings for all versions of my site in a single web.config file by using different sections. Eg: <siteConfig> <machine name="XENON">...
2
by: murl | last post by:
Below is what i have as the custom section in the web.config file... <?xml version="1.0" encoding="utf-8" ?> <configuration> <!-- register local configuration handlers --> <configSections>...
3
by: rdcpro | last post by:
Hi all, I've been building a nifty deserializing configuration handler that I use in conjunction with my web.config in an ASP.NET web app. This is working quite well, but I'm planning on...
4
by: Vagif Abilov | last post by:
Our .NET applications and Web sites use configuration files with custom sections. It's no problem to read a section with dots in its name from a Windows .NET application, e.g....
1
by: npaulus | last post by:
Hi I am trying to experiment with a custom configuration section in app.config but it just doesnt work. app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections>...
2
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application =...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.