If you know the name and location of the .EXE, you could just open it
yourself:

Configuration config = ConfigurationManager.OpenExeConfiguration(exePath);
NameValueCollection configFileValues =
ConfigurationManager.GetSection("appSettings") as NameValueCollection;

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Knowlton, Gerald
F.
Sent: Friday, December 01, 2006 4:51 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] Using the app.config file

Good morning all,

I'm not sure how to best describe this situation, but here goes.

I have this application name "X" which calls a dll named "Y" which calls
a dll named "Z". All are 2005 .NET built.

What I wanted to do was be able to put some configuration values in the
app.config that is associated with "X" so that "Z" would be able to read
those configurations stored in X.App.Config file.

The only way I could see to be able to do that was to first create a
app.config file for "Z" then populate it with the values I would need
for that dll. I did this so I could compile "Z" with the
my.settings.<value> code.

I then took the same configuration names and values that I created in
"Z" and put them into the application "X" (which is two levels up in the
food chain). I thought a dll would always try to read the highest level
of app.config(it's parent parent configuration file) if one existed with
the values it needs. Apparently that is not true, or I have missed
something in the planning of this project.

My goal is to have the called dll read it's parent config file. Is this
possible?


Best regards,

Jerry Knowlton

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to