I have a solution with four projects - Project 1, Project 2, etc. Each project has an app.config file. I am trying to reference the System.Configuration.ConfigurationManager.ConnectionStrings from Project 4 in a call from Project 1.
So in Project 1, I have:
UtilitiesClass util = new UtilitiesClass();
string connectionString = util.getConnectionString();
In Project 4, I have a utility:
public string getConnectionString()
{
string cx = System.Configuration.ConfigurationManager.ConnectionStrings["Shared Items.Properties.Settings.ConnectionString"].ConnectionString;
return (cx);
}
The error I get is that the connection string is null. I have run this from Project 4 independently and it gets the connection string without error.