如何在一个应用程序中添加多个web.Config文件 [英] How to Add more than one web.Config Files in one application

查看:151
本文介绍了如何在一个应用程序中添加多个web.Config文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我需要在单个应用程序中添加多个.config文件
这样我就可以根据queryString

Hi all

I have a requirement to add multiple .config files in a single application
so that I can pick one at the runtime, based on a value in the queryString

推荐答案

中的值在运行时选择一个.您可以有多个配置.
但是,您在应用程序中的每个文件夹只能添加一个web.config文件.
You can have multiple configs.
But you can add only one web.config file per folder in your application.


您不能为根文件夹拥有多个web.config文件,您需要为每个文件夹创建单独的文件夹web.config文件.

您可能需要查看以下链接:
一个 [两个 [ ^ ]

希望这些链接对您有所帮助. :)
You can''t have multiple web.config files for root folder, you need to create separate folder for each web.config file.

You might want to look following links:
One[^]

Two[^]

Hope these links prove to be helpful for you. :)


Web.config对于每个虚拟目录应该只能是一个.即使将多个web.config放在一个文件夹中,ConfigurationManager也会仅解析文件Web.config.其他则需要手动阅读.

看看这些链接以拥有多个配置文件:
在ASP.NET Web应用程序中包含多个.Config文件 [在一个应用程序中使用多个配置文件 [ ^ ]
Web.config should be only one for each virtual directory. Even if you place multiple web.config in one folder, ConfigurationManager will only parse the file Web.config. Others you need to read it manually.

Have a look at these links to have multiple config file:
Include Multiple .Config Files in ASP.NET Web Application[^]
Using multiple config files in one application[^]


这篇关于如何在一个应用程序中添加多个web.Config文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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