none
Reading App.config file RRS feed

  • Question

  • Hi i am facing problem in reading custom App.config file can any one tell me how to read the custom App.config file,
    if possible sample code.

    Thanks in advance

    Regards
    Nivas
    Thursday, September 27, 2007 12:39 PM

Answers

  • Use ConfigurationManager or Configuration to read it.  Trying to parse the data manually using XML is too much work and doomed to failure IMHO.

     

    Michael Taylor - 9/28/07

    http://p3net.mvps.org

     

    Friday, September 28, 2007 1:19 PM
    Moderator
  • If you will put the information through the property of the project, VS2005 will make a class that will help you to get the data.

     

    Project -> [Application name] Properties -> Settings

     

    Code Block

    WindowsApplication1.Properties.Settings s = new WindowsApplication1.Properties.Settings();

    string str = s.mySett;

     

    Friday, September 28, 2007 9:02 PM

All replies

  • Use ConfigurationManager or Configuration to read it.  Trying to parse the data manually using XML is too much work and doomed to failure IMHO.

     

    Michael Taylor - 9/28/07

    http://p3net.mvps.org

     

    Friday, September 28, 2007 1:19 PM
    Moderator
  • If you will put the information through the property of the project, VS2005 will make a class that will help you to get the data.

     

    Project -> [Application name] Properties -> Settings

     

    Code Block

    WindowsApplication1.Properties.Settings s = new WindowsApplication1.Properties.Settings();

    string str = s.mySett;

     

    Friday, September 28, 2007 9:02 PM