I have a rather strange situation that is connected with something incredibly obvious, but it puzzled me.
Simply put, I'm trying to load some configuration data into my application as follows:
namespace XMLGrabberCS { class Grabber { public static void Main() { string test = "test"; string serverName = ConfigurationManager.AppSettings["ServerName"]; try {
Pretty simple stuff, except that if you request (i.e. via Quick Watch) any variable, you get the error variable doesn't exist in current context .
If you look at ConfigurationManager.AppSettings["ServerName"] , it returns the correct value ...
What's going on here?
source share