Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I keep reading that the new MVC avoids using System.Web by default as that used to add lots of extra stuff automatically.
Does that mean that in order to read the config file now in MVC5, one should use from System.Net instead?
Thanks...
It should be:
string key = System.Configuration.ConfigurationManager.AppSettings.Get("AppKey");
OR
string key = System.Configuration.ConfigurationManager.AppSettings["AppKey"];
Add a comment
I read somewhere in a Microsoft example where they imported
using System.Configuration;
and then use the standard
ConfigurationManager.AppSettings["MyKey"]
Just thought to post this in case somebody has the same question/problem
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.