The overload of the OpenExeConfiguration method that you mentioned is the one
that I am using.
Here is what I did yesterday evening. In order to get something to work
quickly, I downloaded the sample application from the current issue of MSDN
magazine (about configuration files). I replaced the line of code
config =
ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None)
with
config = ConfigurationManager.OpenExeConfiguration("d:\test .config")
I have a file named test.config with the exact same contents as the
app.config in the application located a "d:\test.config". When I run the
application, the custom sections are ignored. When I run the application
with the original line of code, the custom sections are processed.
Is there something I am doing wrong with this?
Thank you,
Jason Richmeier
"Greg Young" wrote:
For any app domains that you create you can use
AppDomainSetup.ConfigurationFile but since you do not control the creation
of your default application domain you cannot change the name. A thought
might be that you could spawn off a secondary domain from the main domain
(changing the name of the config)
Another idea would be to use ConfigurationManager.OpenExeConfiguration(file)
http://msdn2.microsoft.com/en-us/library/ms224437.aspx which would return
you a seperate Configuration object for the file.
Cheers,
Greg Young
MVP - C#
"Jason Richmeier" <js*@noemail.noemail> wrote in message
news:02**********************************@microsof t.com... Is it possible to create a custom configuration file (other than
app.config)
that can be processed by classes in the System.Configuration namespace?
I have seen a ton of articles that talk about custom sections (inside the
app.config file) but I would like to make an entirely new config file. I
opened a custom config file with the ConfigurationManager class but it
seemd
as if it ignored all of the content in the config file.
Is there any decent documentation that covers this topic?
Thank you,
Jason Richmeier