473,396 Members | 1,804 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,396 software developers and data experts.

CMAB in class library using machine.config

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 differ in machine.config file.

When using the out of the box functionality, I get a FileNotFoundException
thrown for ....\TestApplication.exe.config
when executing:
>>>> Hashtable configdata =new Hashtable();
configdata["ConnectionString"]="Provider=MSDAORA....";
ConfigurationManager.Write(configdata);>>>>>


What does this indicate? Invalid/unsufficient configuration data

Any suggestions would be very appreciated, cause I don't seem to find the
cause. Looking into the code indicates that this file is tried to be read in
a ConfigSectionHandler:

_xmlAppConfigDoc.Load(
AppDomain.CurrentDomain.SetupInformation.Configura tionFile );

But It's never indicated the file should exist. When I try to create the
file manually, it gets delete at program startup.

Kind regards,
Mattias

machine.confg excerpt:

....
<section name="applicationConfigurationManagement" type="..." />
<section name="TheRegistry"
type="...HashtableSectionHandler,...."/>
</configSections>
<!-- Configuration Management Application Block -->
<applicationConfigurationManagement defaultSection="TheRegistry">
<configSection name="TheRegistry">
<configProvider assembly="..." type="....RegistryStorage"
registryRoot="LocalMachine" registrySubKey="Software\MyClassLib"/>
</configSection>
</applicationConfigurationManagement>
Jul 21 '05 #1
0 1325

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

Similar topics

10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
1
by: R. Raghuraman | last post by:
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...
3
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
5
by: AAguiar | last post by:
I have an asp.net project where the code behind the aspx page calls a c# class which makes calls to a managed static C++ class. The C# class works fine when the asp net worker process starts, when...
10
by: bradtm | last post by:
So I have this hierarchy: + Solution | |--- + Class Library Project | | | |--- LogError.vb | |--- + ASP .NET Web Application |
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...
3
by: Fernando Chilvarguer | last post by:
Hello! I created a Class Library project in VS2005. Then, using VS, I was able to add a connection string to the project settings, which automaticaly created an app.config file for me. If I try...
8
by: Mihai Velicu | last post by:
Hi ! I created a class library and in it I have a class that call "ConfigurationManager" to find out what type of database I work and the connection string.When I call this class from a form,...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 =...
0
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...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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.