ConfigurationManager not working ConfigurationSettings obsolete...

When I use ConfigurationSettings, I get...

Warning 1 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'

When I use ConfigurationManager I get...

Error 1 The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference )

I have the using System.Configuration reference in my file. What could I be doing wrong

I'm using VS2005 Pro, WinXP.



Answer this question

ConfigurationManager not working ConfigurationSettings obsolete...

  • Yo123

    Hi,

    You have to Add Reference to the System.Configuration.dll assembly since the ConfigurationManager class is in that assembly.

    Regards,

    Saurabh Nandu

    www.AksTech.com <outbind://139/www.AksTech.com>



  • chadbengen

    That was it. Thanks for helping.
  • AmandaB

    Hi

    I'm having the same problem. I'm using Visual C# Express Edition under 2.0 fmk. I have System.Configuration.dll but it does not have a reference to the ConfigurationManager class, only ConfigurationSettings.

    Cheers



  • ZJames Ma

    The most likely issue is that you're missing a reference to the System.Configuration.dll. This particular deprecation was certainly one of the most confusing, because the new type is actually in a completely different assembly. System.Configuration.ConfigurationSettings was in System.dll.

    Hope that helps!
    Anson Horton
    C# IDE PM



  • Michael McCormack - MS

    Solved my problem...

    I had do add a reference to thr project!



  • gadym

    The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference )

    I have the using System.Configuration reference in my file. please tell me how to fix the problem..


  • Scott Michael

    Please note, you are the man.

  • KTsmom

    Screw THAT!!

    It's just a WARNING - It won't stop the compile.

    I'm using the normal config file and the old way.

    It works fine and I'm not setting a DLL REFERENCE just to SET CONFIG VALS!!


  • ConfigurationManager not working ConfigurationSettings obsolete...