Skip to content
Advertisement

ConfigurationManager in WPF

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.

Advertisement

Answer

I’ve figured it out! I shouldn’t have created a new config file. There is a default app.config file in the project. Now everything is fine.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement