嵌套的app.config(web.config文件)文件文件、嵌套、config、app

2023-09-04 00:54:05 作者:孤独一身ㄣ╰☆ぷ

是否有可能有两个的app.config文件,其中一个的app.config作为容器第二(嵌套)app.config文件?我想引用一个嵌套的文件的特定部分从外部之一。

Is it possible to have two app.config files where one app.config serves as a container for second (nested) app.config file? I would like to reference specific sections of a nested file from the outer one.

为什么我需要这是因为源代码控制问题。有关详细说明,请参见这个

Why I need this is because of source control issue. For detailed description see this

任何其它解决方案,问题的根源是大大AP preciated。

Any other solution for the root problem is greatly appreciated.

推荐答案

您可以参考其他配置文件,是的,所以您可以有静态的东西在一个文件中,与机器具体的东西别人了。

You can reference other config files yes, so you can have static stuff in one file, and machine specific stuff in another.

例如,把应用程序设置在一个单独的文件中,在一个名为配置子文件夹:

Eg, to put app settings in a seperate file, in a subfolder called "configuration":

<appSettings configSource="Configuration\AppSettings.config"/>

然后在AppSettings.config,只包括标签的appSettings正常:

Then in the AppSettings.config, just include the appSettings tag as normal:

<appSettings>
   <add key="somekey" value="someValue" />
</appSettings>
 
精彩推荐
图片推荐