Cannot access app.config or settings.settings data
Posted
by J Carron
on Stack Overflow
See other posts from Stack Overflow
or by J Carron
Published on 2010-04-09T18:30:51Z
Indexed on
2010/04/09
18:33 UTC
Read the original article
Hit count: 614
I have 3.5 application needed to load a string from settings.settings or app.config. I made sure have reference to ConfigurationManager but very simple call from form load value returns null here is 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. }
© Stack Overflow or respective owner