I have a web application which is using a dll of a class library. I am unable to access the app.config value in the class library
How I’m trying to access app.config:
ConfigurationSettings.AppSettings["conStr"].ToString();
this is returning a null value
Also when I try to use ConfigurationManager it says not found or missing assembly reference.
using System.Configuration is also added .
You must put the
AppSettingsvalue inside theweb.configof the application, because it override theapp.configfrom the class library.Add a reference to
System.Configurationnamespace in the class library project, them get the value you’re expecting from theweb.configfile, not from theapp.configfile.