I am trying to pull a value from my Web.Debug.Config file most specifically from the AppSettings, it’s just a string “Here are the books”. But I get an object reference not set to an instance of an object. What do I need to fix, I am just trying to pass this to a Text Box
string s = System.Configuration.ConfigurationManager.AppSettings["mybooks"];
TextBoxq.Text = s;
Thank you
Web.Debug.config app settings:
<appSettings>
<add key="mybooks" value="my test label value"/>
</appSettings>
Most likely problem is that you aren’t using “WebDeploy” which means that the .Debug version of your config file is ignored. If that’s the case, put the setting in Web.Config directly and try again. If that’s not the case, post the relevant pieces of your config file so we can help.