PC Review


Reply
Thread Tools Rate Thread

CMAB in ClassLibrary using machine.config issue

 
 
Mattias
Guest
Posts: n/a
 
      27th Nov 2004
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.ConfigurationFile );

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>


---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
 
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
web.config parameters inside compiled ClassLibrary Lupus Microsoft ASP .NET 1 18th May 2007 03:16 PM
How to use config file in classlibrary project (dll). =?Utf-8?B?U3RlZmFu?= Microsoft Dot NET 7 21st Apr 2006 09:22 AM
ClassLibrary.DLL and app.config files A.M-SG Microsoft C# .NET 7 21st Sep 2005 03:02 AM
App.config classlibrary Alex Kid Microsoft VB .NET 1 21st Jan 2005 04:49 PM
CMAB in class library using machine.config Mattias Microsoft Dot NET 0 27th Nov 2004 09:45 PM


Features
 

Advertising
 

Newsgroups
 


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