Skip to content

Fixing Obsolete System.Configuration.ConfigurationSettings.AppSettings in C#

Okay this is a quick one. If you’re having “‘System.Configuration.ConfigurationSettings.AppSettings’ is obsolete: ‘This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings’” as error message when working with C#, then you have come to the right place for the fix. Here we go then.

To fix it, just add a reference to “System.Configuration.dll“. And change from “ConfigurationSettings.AppSettings” to “ConfigurationManager.AppSettings“. (C# code example below)

Now if you have no idea what this gibberish above means, here is an in detail explanation. Non-noobs, please read no more. Noobs, follow the steps.

  1. Right-click on your project, look for Add Reference and click on it
  2. Choose the .Net tab and search for System.Configuration on the list
  3. Click on OK
  4. Now that the reference is added, just replace ConfigurationSettings.AppSettings with ConfigurationManager.AppSettings in your code. (C# code example below)

So if your code was like:


It should now be like:


Now that this is fixed, you can get back to work on your project. It is an easy fix as you can see, but it’s not intuitive. I had to find the fix on Hope this helps some of you out.

Published inCoding
  • Nacho Regal

    Hello, this is about the 5th website I have been to that has said the same thing and the problem still persists.

    Fucking Microsoft man, they’re fucked, why even change this shit….I so wanna quit being a programmer right now…

    I could have implemented my own now…all the time i’ve spent trying to figure this shit out that should be EASY…wtf man…

    Fuck…can you tell I’m pissed off?

  • Yes I can tell you are pissed. πŸ˜‰

    I know what you are going through. I have had a lot of problems where people have suggested me the same fix over and over again.

    What I’d advise you is to create a new project, add the “System.Configuration” reference and try the sample code given in the post. If that works, you can start migrating your code to the fresh project.

    Hope this helps.

    • This is exactly how I did it and it worked for me. Good easy fix. A tip of the hat to you, sir!

  • Nacho Regal

    Sorry about the rude unsavory comments on your blog πŸ™

    Thank you, your code did actually work (well it’s compiling at least), and is easier and to the point than any the other few blogs I was at. I had a follow up problem where it’s not reading the keys. I haven’t gone back to look at it yet though.

    Is it just me though? or does this just seem like a really stupid thing to change? What possible reason could Microsoft have for changing it? It’s not like the implementation is any better.

    I don’t see good things coming from Microsoft in the next 5.10 or so years, it’s gonna be change after unnecessary change due to their business model which will inevitably flounder…I guess that’s a different topic though.

    Thanks heaps for your help, and I will go back to look at my problem soon πŸ™‚

  • Nacho Regal

    lol….I’m back again. It refuses to work.


    Says: “Specify the connection string either in machine.config or web.config”


    Says: “data source=.\SQLEXPRESS;Integrated Security=SSPI;etc etc”

    So my project must think that it’s a website or something, but its a WPF application. Am I horribly confused? I want to retrieve the keys from app.config

    I’m so just thinking of doing my own, I’d have got that working in like 5 minutes! Frustration is starting to rise again!!! lol…

  • Nacho Regal

    I’m so sorry to leave so many posts on your blog πŸ™ I have solved the problem.


    I hope that helps someone and demonstrates what a noob I am πŸ™‚

    Thank you

  • Hey it’s nice to hear that you have managed to solve your problem.

    I have not seen into why Microsoft decided to change this. I agree that its not very practical. I’ll have to read on that some time. And maybe do an article about my findings… πŸ˜‰

  • Dietrich

    Nacho Regal,

    Thanks for the solution! Saved me a great deal of time (even though I had spent a fair amount of time trying to figure this out).


  • Pingback: “Obsolete System.Configuration.ConfigurationSettings.AppSettings” hatasΔ± « meturhan()

  • Pingback: VS2010 System.Configuration.ConfigurationSettings.AppSettings is obsolete ­ SmatterChew()

  • Muzammil Khan

    I am trying to resolve the issue of System.Configuration!System.Configuration.ConfigurationManager.AppSettings[“DALAssembly”]
    in C#.

    I have:
    1. Added Reference of System.Configuration
    2. Added using System.Configuration

    but still getting error on
    1. System.Configuration!System.Configuration.ConfigurationManager.AppSettings[“DALAssembly”]
    2. ConfigurationManager.AppSettings[“DALAssembly”]

    Can Anyone please help in this regard.

    • Seems strange. I’d advise you to do a Clean then a Rebuild.
      And if all else fails, try starting a new project, then import the proper files.

  • Dave Bush

    I had the same issue. Whenever I removed the System.Configuration reference I still could not add the call to the ConfigurationManager. This was on an upgraded project from vs2005 to vs2010, I’m not sure if that is a factor.

    Howeverm I solved the issue by simply removing the reference to System (System.DLL) and I was then able to reference the namespace correctly.

    Hope this helps!

  • Shafeer

    Thank you dear , Very helpful post, We are expecting more and more ……………….

  • bugfix

    Thanks. That was quick and to the point help for a .NET noobie like me

  • Angie

    Thank you for the Noobie information (I didn’t know how to add a reference to a dll).
    I’ve been searching for quite awhile, and you’ve given me everything I needed.

  • Hasan

    Thanks Jevin
    its work

  • Dodz

    Thanks a lot man it helps me a lot.

  • Bill

    Thanks, so easy and fast

  • Thanks, it worked

  • Sheau

    Thanks Jevin. It really help me.

  • hub


Twitter Profile Picture

Jevin Sew

1645 Tweets
274 Following