views:

110

answers:

0

I have a .Net 3.5 application that needs to load a string from settings.settings or app.config. I made sure I have a reference to ConfigurationManager but a very simple call from form load value returns null.

Here is the code:

void LoadSettings()
{
    //  I expect to get from my app.config or settings.settings
    // Settings file set to application, public
    m_connStr = System.Configuration.ConfigurationManager.AppSettings["somestring"];
    // m_connStr is getting Null. I tried .ToString(); That throws a null exception.
}