Dynamic Properties, App.config, and <AppName>.exe.config

  • Thread starter Thread starter DPlsn
  • Start date Start date
D

DPlsn

I am having trouble understanding the relationship between Dynamic
Properties, the App.config file, and the bin\<AppName>.exe.config
file. When I create dynamic properties from the IDE, the forms
designer inserts xml nodes in the app.config file and inserts code to
read values from those nodes (via a call to
configurationAppSettings.GetValue()) on the form where the dynamic
properties were set up. When I execute the application, the
app.config file is copied as the bin\<AppName>.exe.config file.

I am surprised to find the IDE, which automatically generates code to
read the dynamic properties, does not generate similar code to write
those dynamic properties back. Unless I am missing something obvious,
this task is left to entirely user.

Note that under the IDE, the IDE generated call to
configurationAppSettings.GetValue() is reading from the app.config
file.

I have found a couple of complete subroutines which write values back,
but they all write to the bin\<AppName>.exe.config file. Obviously,
since under the IDE values are manually written to the
bin\<AppName>.exe.config, they will never be read via
configurationAppSettings.GetValue().

So here's the question: Should I replace the IDE generated dynamic
properties read code with code to read from the
bin\<AppName>.exe.config file? Or should I change the code I stole
(from much smarter programmers than I) and write to the app.config
file instead?

Thanks for any help!

Doug
 
Back
Top