Can I create .config file and include it to web.config?

前端 未结 2 720
既然无缘
既然无缘 2020-12-04 21:50

Can I create .config file and include it to web.config? How can i do this?

UPD. If you want to separate config file, for example, move appSettings to another file yo

相关标签:
2条回答
  • 2020-12-04 22:39

    It is not entirely clear what you want to do, but all configuration sections can be stored in a separate files and be referenced by the main .config file using the configSource property.

    See this blog post for details.

    0 讨论(0)
  • 2020-12-04 22:47

    This is the way to integrate multiple configs into one web.config

    Code in web.config:

    <appSettings configSource="config\appSettings.config"/>
    <nlog configSource="config\nlog.config"/>
    <applicationSettings>
            <MyApp.UI.Properties.Settings configSource="config\Settings.APGUI.config"/>
            <MyApp.BusinessServices.Properties.Settings configSource="config\Settings.Business.config"/>
            <MyApp.Auditing.Properties.Settings configSource="config\Settings.Auditing.config"/>
    </applicationSettings>
    

    more: Managing complex Web.Config files between deployment environments

    0 讨论(0)
提交回复
热议问题