How to make sure a project Application setting reads from the config file?

E

Eric

I inherited some code that uses the settings designer to manage some app
settings. One of the settings is a connection string that has a
DefaultSettingValueAttribute with hard coded text for a connection string. I
would like it to read from the app.config file at runtime, but am not sure
how to get it to do that. I tried putting in code to read the config
section in the attribute instead of the text, but it didnt compile.

If I open the settings in the designer it says the app.config has changed
and do I want to update the default value, but that's not the same as
reading it at runtime. I dont want to have to open the project in the
designer and redeploy when I change the connection string in the app.config
file.

Is there a way to make it simply read the config file each time?

Thanks,
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top