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.

webconfigfile

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

twittergoogle_plusredditpinteresttumblrmail

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


Leave a Reply

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