开发者

Sharing custom config section across multiple systems

I have multiple projects like WEB / EXEs / WCF services / windows services in my solution and all these systems are referring to custom configuration section settings as mentioned below. At present, I have copied this custom config section to each and every web.config / exe.config files and I feel, with this approach, I will have to modify and edit the corresponding web.config / exe.config files whenever there is any modification is done to my custom config section. I feel, this approach is going to be cumbersome and difficult to manage going forward. Is there any better approach for handling this scenario so that I need to maintain custom config section in a separate config file and I need to refer this config file (and read corresponding settings from config section) in each and every project config file? Kindly let me know your valuable tips.

Custom config section:

  
  <configSections>
    <section name="CustomConfigSection" type="Company.Product.ConfigSettings.CustomConfigSection, Company.Product.ConfigSettings" />
  </configSections>

  <Custom开发者_StackOverflow中文版ConfigSection>
     other relevant settings 
  </CustomConfigSection>


Does storing the custom config in an external file help?

http://blog.andreloker.de/post/2008/06/16/Keep-your-config-clean-with-external-config-files.aspx


You could store settings in the registry as an alternative option.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜