哪个配置文件优先 [英] Which config file get first prefernce

查看:72
本文介绍了哪个配置文件优先的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Web应用程序从哪个配置文件运行时,它首先从machine.config或web.config获取值?

When web application runs from which config file it takes value first from machine.config or web.config?

推荐答案

基本情况是,存在一个与Machine.config文件位于同一目录中的根Web.config文件. Web.config根文件继承了Machine.config文件中的所有设置.它包括适用于运行特定版本的.NET Framework的所有ASP.NET应用程序的设置.


因为每个ASP.NET应用程序都从根Web.config文件继承默认配置设置,所以您只需要为要覆盖的设置创建Web.config文件.

因此从根本上说,事实是它的层次结构源于Machine.config-> root web.config->我们的应用程序特定的web.config.
Basicaly the scenario is that there is a root Web.config file that is located in the same directory as the Machine.config file. The root Web.config file inherits all the settings in the Machine.config file. It includes settings that apply to all of the ASP.NET applications that run a specific version of the .NET Framework.


Because each ASP.NET application inherits default configuration settings from the root Web.config file, you need to create Web.config files only for settings that you want to override.

so basicaly the fact is its a heirarchy that roots from Machine.config->root web.config->our application specific web.config.


web.config或应用程序中的设置. config覆盖machine.config中的设置.


请在此处阅读: http://forums.asp.net/t/1117776.aspx/1 [ ^ ]
[/编辑]

问候,

曼弗雷德(Manfred)
Settings in web.config or app.config override settings in machine.config.


Please read here: http://forums.asp.net/t/1117776.aspx/1[^]
[/Edit]

Regards,

Manfred


这篇关于哪个配置文件优先的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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