Web Config Shenanigans

One of the things that I love about IT is that it (small this time) is like a huge puzzle. I’ve probably said this before, but I get enormous satisfaction out of solving problems and understanding how that little obstacle that is in front of me can be decomposed and dissected until I fully grasp its metal 🙂

Well, that’s what I just had today.

It was a cold morning in London and here I was, minding my own configuration business, adding in app settings to try and make my project more flexible. This is a small snippet of what I added into my web.config file:

Pretty straight forward, right? So why couldn’t I read that setting when I did this:

Each time, I got the dreaded null. Did I make a typo with the name? Nope. Were my appSettings correct XML? Yes, besides, VS would have complained. Do I even have a value? Err. Definitely. I know, maybe I should be using ConfigurationManager instead. No, that can’t be right – this is a web project. So what could it be?

Here, you can see a screenshot of my config file.


And that, dear reader, sums up the problem! #MakeSureYouEditTheRightConfigFile


Written by Stephen Moon
email: stephen at logicalmoon.com
www: https://www.logicalmoon.com

Hey! Did you enjoy reading this? If you did and would like an email when I add new content, just subscribe to my list. You can unsubscribe at any time.

Leave a Reply

Your email address will not be published. Required fields are marked *