Console application is not taking config values from its config file after deployment

Viewed 781

In my console application,it has application settings created and also has app.config file.

After build I get appname.exe and appname.exe.config (it has test configuration values).

when I deploy these files on production and change some entries in appname.exe.config according to Production and run the application via scheduler.

it still gets test configuration values somehow, is there something I messed up with the configuration values. for me it looks like somehow appname.exe has taken the entries from application settings and not loading appname.exe.config

2 Answers

If I recall correctly, if you are using the Settings UI in Visual Studio to setup your configuration...

  • Settings are stored within the application's configuration file appname.exe.config
  • these settings also have a corresponding default value that are embedded within the application
    • the default value is what you type into the Settings UI
  • if the configuration values cannot be read from the appname.exe.config, then the default values are returned.

this happens because your setting scope is set to Application rather than user

just open your *.settings file in visual studio and change the scope of your property to user

Related