c# - Avoid version specific information in configSection in app.config -


i have made small gui administration of settings in app.config file. gui released part of product, making possible change values in app.config file, without opening in text editor.

the properties implemented in custom configsection, making typed in code. problem is, when app.config file updated (when save gui), qualified name of assembly written in configsection this:

<section name="configurationsettings" type="performancedude.msbuildshellextension.common.configurationsettings, common, version=2.2.1.0, culture=neutral, publickeytoken=1ab1b15115e63xxx" /> 

when upgrade assembly new version number, gui code assembly version not longer matches assembly references in app.config.

this how load settings:

var config = configurationmanager.openmappedexeconfiguration(new execonfigurationfilemap() { execonfigfilename = configfilepath }, configurationuserlevel.none); var settings = config.getsection("configurationsettings") configurationsettings; 

this how save settings:

config.save(configurationsavemode.minimal, true); 

i don't want write upgrade script changing version everytime update. know great solution problem?

i've had similar thing before. ended loading config file xml, de-serializing relevant sections objects, putting them xml. avoiding .net configuration api in way avoid issues version.

another approach redirect old version of assembly new version. if assembly in gac, can use policy files this, , deploy them when deploy new version; version numbers in config won't matter.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -