2011-02-08 49 views
2

我的解決方案中有多個項目,如WEB/EXEs/WCF服務/ windows服務,並且所有這些系統都指的是自定義配置節設置,如下所述。目前,我已將這個自定義配置部分複製到每個web.config/exe.config文件,我覺得,使用這種方法,我將不得不修改和編輯相應的web.config/exe.config文件,只要有我的自定義配置部分進行了任何修改。我覺得,這種方法將會很麻煩,而且很難繼續管理。有沒有更好的方法來處理這種情況,以便我需要在一個單獨的配置文件中維護自定義配置節,並且我需要在每個項目配置文件中引用此配置文件(並從配置節讀取對應的設置)?請讓我知道你的寶貴提示。跨多個系統共享自定義配置節

自定義配置部分:

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

    <CustomConfigSection> 
    other relevant settings 
    </CustomConfigSection> 

回答

0

你可以存儲在註冊表中的設置作爲一種替代選擇。