且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在运行时动态选择Web Config

更新时间:2023-12-06 14:57:58

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[^]


感谢sandeep的回答,我已经访问了链接,但不能解决我的问题
thanks sandeep for your answer i have already visited the links but it did not solve my problem