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

查看:44
本文介绍了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 属性,然后将所有内容包含在 <;connectionStrings> 元素

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天全站免登陆