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

Discussion in 'ASP .Net' started by Eric, Mar 6, 2007.

  1. Eric

    Eric Guest

    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

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

    Eric, Mar 6, 2007
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.