How to load the App.config file?

Posted by Amokrane on Stack Overflow See other posts from Stack Overflow or by Amokrane
Published on 2010-05-10T15:43:21Z Indexed on 2010/05/10 15:54 UTC
Read the original article Hit count: 486

Filed under:
|
|

Hi,

I'm parsing the App.config file of a project. This config file has been loaded from a caller project. Inside the called project, I have something like:

   XmlDocument xmlDoc = new XmlDocument();
   xmlDoc.Load("app.config");
   // Some parsing...

Unfortunately the app.config file is not correctly located. Apparently the Load method is browsing the ~/bin/Release directory of the caller project, but the app.config file is located in the ~ directory.

Is there any way I can load this App.config file correctly?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET