Sunday, February 13, 2011

Easiest way to read a config file belonging to another application

Hi

Other than using raw XML, is there an easy way in .NET to open and read a config file belonging to another assembly...? I don't need to write to it, just grab a couple of values from it.

Thanks

  • Have you tried ConfigurationManager and OpenExeConfiguration(path)? (in System.Configuration.dll)

  • Here's MSDN on OpenExeConfiguration.

    And here's a shorter explanation of how to use it, including how to alter the file.

    DrG : are you sure about that link to OpenExeConfiguration on MSDN?
    DOK : Thanks, in spite. I've updated that link.
    From DOK
  • Thanks all for the quick answers

    DOK : That's what we're here for.
    From Matt

0 comments:

Post a Comment