I have a C# class library A which has some configuration settings in its App.config I access them with
Method1()
{
string connectionString = ConfigurationManager.AppSettings["ConnectionString"];
}
But when I call Method 1() from my ASP Web project B, it cannot find the configurations settings in the Class library A
Any idea what is happening here?
Pravesh Singh
31-Jan-2014I believe you can use OpenExeConfiguration to do this:
You could put the path of the other .exe in the web app's web.config (for instance, in the appSettings section), and read it from there, which would be better than hard-coding it here.
to view the appSettings in that config file:
AppSettingsSection otherAppSettings = otherConfig.AppSettings;