System.Configuration.CofigurationSettings.AppSettings is obsolete. ANY SOLUTION?

Discussion in 'ASP .Net' started by Randy Smith, Jul 3, 2007.

  1. Randy Smith

    Randy Smith Guest

    Hi ALL,
    I am getting this strange warning message, and I can't seem to find any
    solution for it.

    'System.Configuration.CofigurationSettings.AppSettings is obsolete: it has
    been replaced by
    System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
    So, does anyone have a solution to this warning message?

    TIA, Randy
     
    Randy Smith, Jul 3, 2007
    #1
    1. Advertising

  2. RE: System.Configuration.CofigurationSettings.AppSettings is obsolete.

    Yes, it is obsolete. Make sure your project has a reference to
    "System.Configuration". Put a "using System.Configuration" statement at the
    very top of your class. Then, do this:
    string myValue = ConfigurationManager.AppSettings["mykeyname"];

    in VB.NET:

    Dim myValue as String = ConfigurationManager.AppSettings("mykeyname")

    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    BlogMetaFinder(BETA): http://www.blogmetafinder.com



    "Randy Smith" wrote:

    > Hi ALL,
    > I am getting this strange warning message, and I can't seem to find any
    > solution for it.
    >
    > 'System.Configuration.CofigurationSettings.AppSettings is obsolete: it has
    > been replaced by
    > System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
    > So, does anyone have a solution to this warning message?
    >
    > TIA, Randy
    >
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jul 3, 2007
    #2
    1. Advertising

  3. Re: System.Configuration.CofigurationSettings.AppSettings is obsolete. ANY SOLUTION?

    Hi Randy;

    Use ConfigurationManager.AppSettings("<SettingName>")

    Cheers,

    -Mark
     
    Mark S. Milley, MCSD (BinarySwitch), Jul 3, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SB

    Did I buy obsolete book?

    SB, Mar 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    434
    Jon Skeet [C# MVP]
    Mar 19, 2006
  2. phillip
    Replies:
    0
    Views:
    5,879
    phillip
    Nov 6, 2003
  3. =?Utf-8?B?TmVvIFRoZSBPbmU=?=

    RegisterStartupScript is declared 'obsolete', then what is...

    =?Utf-8?B?TmVvIFRoZSBPbmU=?=, Aug 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,333
  4. newhorizon

    now obsolete

    newhorizon, Nov 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    531
    Steve C. Orr [MVP, MCSD]
    Nov 19, 2005
  5. Oriane
    Replies:
    3
    Views:
    1,607
    Steven Cheng
    Mar 31, 2009
Loading...

Share This Page