473,782 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 HashtableSectio nHandler. However,
when I try to replace this with DictionarySecti onHandler, I get a null
reference exception:

See below for App.config file and the referenced config file.
Unhandled Exception: System.TypeInit ializationExcep tion: The type
initializer for "LNUK.Framework .Co
mmon.DBWrapper" threw an exception. --->
System.NullRefe renceException: Object reference not set to
an instance of an object.
at System.Configur ation.HandlerBa se.CheckForUnre cognizedAttribu tes(XmlNode
node)
at System.Configur ation.Dictionar ySectionHandler .Create(Object
parent, Object context, XmlNode se
ction)
at Microsoft.Appli cationBlocks.Co nfigurationMana gement.Configur ationManager.Re ad(String
sectionNa
me) in C:\Program Files\Microsoft Application Blocks for
..NET\Configura tion Management\Code \VB\Micro
soft.Applicatio nBlocks.Configu rationManagemen t\Configuration Manager.vb:line
164
at LNUK.Framework. Common.DBWrappe r..cctor() in
C:\Raghu\Codeba se\DatabaseWrap per\DatabaseWra pper\
DBWrapper.vb:li ne 149
--- End of inner exception stack trace ---
at LNUK.Framework. Common.DBWrappe r..ctor()
at SimpleRun.main( ) in
C:\Raghu\Codeba se\DatabaseWrap per\DBWrapperTe sts\SimpleRun.v b:line 12

This is my app.config file

<configuratio n>
<configSections >
<section name="applicati onConfiguration Management"
type="Microsoft .ApplicationBlo cks.Configurati onManagement.Co nfigurationMana gerSectionHandl er,Microsoft.Ap plicationBlocks .ConfigurationM anagement,
Version=1.0.0.0 ,Culture=neutra l,PublicKeyToke n=null" />
<section name="DBConfigS ection"
type="System.Co nfiguration.Dic tionarySectionH andler,System,V ersion=1.0.5000 .0,
Culture=neutral ,PublicKeyToken =b77a5c561934e0 89" />
</configSections>
<appSettings>
<add key="log4net.Co nfig"
value="C:\Raghu \Codebase\Datab aseWrapper\log4 net.config"></add>

</appSettings>

<applicationCon figurationManag ement defaultSection= "DBConfigSectio n">
<configSectio n name="DBConfigS ection">
<configProvid er assembly="Micro soft.Applicatio nBlocks.Configu rationManagemen t,Version=1.0.0 .0,Culture=neut ral,PublicKeyTo ken=null"
type="Microsoft .ApplicationBlo cks.Configurati onManagement.St orage.XmlFileSt orage"
path="..\..\Con fig\Database.co nfig"
signed="false"
encrypted="fals e" />
</configSection>
</applicationConf igurationManage ment>
</configuration>

This is my Database.config file referred above

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<DBConfigSectio n>
<add key="ConnectStr ing" value="Persist Security
Info=False;Inte grated
Security=SSPI;d atabase=TestDB; server=LNGWOKD0 11876;Connect
Timeout=30"></add>
<add key="RetryCount " value="3"></add>
<add key="CommandTim eout" value="30"></add>
</DBConfigSection >
</configuration>
Nov 15 '05 #1
1 1934
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********@info sys.com (R. Raghuraman) wrote in message news:<a7******* *************** ****@posting.go ogle.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 HashtableSectio nHandler. However,
when I try to replace this with DictionarySecti onHandler, I get a null
reference exception:

See below for App.config file and the referenced config file.
Unhandled Exception: System.TypeInit ializationExcep tion: The type
initializer for "LNUK.Framework .Co
mmon.DBWrapper" threw an exception. --->
System.NullRefe renceException: Object reference not set to
an instance of an object.
at System.Configur ation.HandlerBa se.CheckForUnre cognizedAttribu tes(XmlNode
node)
at System.Configur ation.Dictionar ySectionHandler .Create(Object
parent, Object context, XmlNode se
ction)
at Microsoft.Appli cationBlocks.Co nfigurationMana gement.Configur ationManager.Re ad(String
sectionNa
me) in C:\Program Files\Microsoft Application Blocks for
.NET\Configurat ion Management\Code \VB\Micro
soft.Applicatio nBlocks.Configu rationManagemen t\Configuration Manager.vb:line
164
at LNUK.Framework. Common.DBWrappe r..cctor() in
C:\Raghu\Codeba se\DatabaseWrap per\DatabaseWra pper\
DBWrapper.vb:li ne 149
--- End of inner exception stack trace ---
at LNUK.Framework. Common.DBWrappe r..ctor()
at SimpleRun.main( ) in
C:\Raghu\Codeba se\DatabaseWrap per\DBWrapperTe sts\SimpleRun.v b:line 12

This is my app.config file

<configuratio n>
<configSections >
<section name="applicati onConfiguration Management"
type="Microsoft .ApplicationBlo cks.Configurati onManagement.Co nfigurationMana gerSectionHandl er,Microsoft.Ap plicationBlocks .ConfigurationM anagement,
Version=1.0.0.0 ,Culture=neutra l,PublicKeyToke n=null" />
<section name="DBConfigS ection"
type="System.Co nfiguration.Dic tionarySectionH andler,System,V ersion=1.0.5000 .0,
Culture=neutral ,PublicKeyToken =b77a5c561934e0 89" />
</configSections>
<appSettings>
<add key="log4net.Co nfig"
value="C:\Raghu \Codebase\Datab aseWrapper\log4 net.config"></add>

</appSettings>

<applicationCon figurationManag ement defaultSection= "DBConfigSectio n">
<configSectio n name="DBConfigS ection">
<configProvid er assembly="Micro soft.Applicatio nBlocks.Configu rationManagemen t,Version=1.0.0 .0,Culture=neut ral,PublicKeyTo ken=null"
type="Microsoft .ApplicationBlo cks.Configurati onManagement.St orage.XmlFileSt orage"
path="..\..\Con fig\Database.co nfig"
signed="false"
encrypted="fals e" />
</configSection>
</applicationConf igurationManage ment>
</configuration>

This is my Database.config file referred above

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<DBConfigSectio n>
<add key="ConnectStr ing" value="Persist Security
Info=False;Inte grated
Security=SSPI;d atabase=TestDB; server=LNGWOKD0 11876;Connect
Timeout=30"></add>
<add key="RetryCount " value="3"></add>
<add key="CommandTim eout" 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
1509
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> <sectionGroup name="emagiCdotNet">
0
1355
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 application (as a Presentation Layer) to access the business logic of the class library. I'd like to store essential configuration details (connection strings, environement settings) in the machine.config file, allowing the DEV/TEST/PROD system only to...
6
8643
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 the answer was just going to be setting some Keep Together properties to Yes. Alas, it was not to be. It turns out that the report in question is actually a combination of 2 other reports based on different tables. The reports should follow one...
4
1922
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"> <site url="/blog/"> <mode value="live">
2
3221
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> <sectionGroup name="cbsoffice"> <section name="data" type="CbsOffice.ProviderConfigurationHandler,CbsOffice"/>
3
2820
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 servicing a number of different web service operations from a single application, and because it's all XML, I've been scoping everything to a specific namespace targeting a specific application (these are all InfoPath forms). It seems that the...
4
1257
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. "MyCompany.Product.Feature". However an attempt to read such section from Web site's web.config file raises exception ("Can not create section handler"). Once the dots are removed, everything works fine. I have not found any documentation that describes such...
1
7785
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> <section name="Regions" type="ConfigSectionHandler.MySectionHandler, ConfigSectionHandler"/> </configSections>
2
5115
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 = Windows Forms class B = a singleton hosted within A. B is responsible for dynamically loading classes X, Y, and Z.
0
9641
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9944
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.