有没有办法为App.config文件引用另一个完整的配置文件? (。净) [英] Is there any way for an App.config file to reference another full config file? (.NET)

查看:605
本文介绍了有没有办法为App.config文件引用另一个完整的配置文件? (。净)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:这个问题,包括标题,被改写,看到历史的细节

我知道下面的App.config包括外部文件:

I know that the following App.config includes a external file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings configSource="appSettings.config"/>
  <system.net>
    <connectionManagement>
      <add address="*" maxconnection="50"/>
    </connectionManagement>
  </system.net>
</configuration>

但我不知道怎么的system.net移动到第二个文件。其实我还没有尝试过,但我几乎可以肯定,这是行不通的,我想知道是否有办法一个app.config包含另一个App.config文件以供参考。

But I don't know how to move the system.net to the second file. Actually I haven't tried it, but I am almost certain that it will not work, and I want to know if there is an way for an App.config to include another App.config file by reference.

推荐答案

我觉得你只是删除了configSource属性,然后包括内的所有内容&LT;的appSettings&GT; &LT;的ConnectionStrings&GT; 元素

I think you just remove the configSource attributes and then include all the content within the <appSettings> and <connectionStrings> elements

这篇关于有没有办法为App.config文件引用另一个完整的配置文件? (。净)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆