I have a config file in a wpf project to store the connectionstring. But when I try to get AppSettings and ConnectionStrings, I get null. the WEB.config file is like this: I tried in several ways: None of them worked. But this one worked: (That means I cannot use a config file, which is against my will) I need help.