如何ASP.NET编译配置文件,如web.config文件或machine.config中? [英] How does ASP.NET compile config files, such as web.config or machine.config?

查看:202
本文介绍了如何ASP.NET编译配置文件,如web.config文件或machine.config中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读这篇问题,我问其中一个答案如下:

In reading this question, I asked in one of the answers the following:

这答案意味着ASP.NET web.config文件中读取并从顶部其他配置文件,即:自上而下的。我想配置文件被读作单一实例,这意味着,编译器首先分析的准确性配置文件,然​​后编译它,但它似乎是编译它的飞行 - 逐行

This answer implies that ASP.NET reads web.config and other config files from the top, ie: top-down. I thought config files were read as a "single instance" meaning that the compiler first parses the config file for accuracy and then compiles it, but it seems to be compiling it on the fly - line by line.

是这样吗?

如何ASP.NET处理配置文件?是否有一个链接,有人可以在ASP.NET与我分享的处理配置文件的顺序?

How does ASP.NET deal with config files? Is there a link someone could share with me the order of processing config files in ASP.NET?

推荐答案

.NET没有永远的编译的配置文​​件。

.NET does not ever compile config files.

它们是XML文件。对于虚拟路径中的文件被读入,并且,就好像是在树的最高的machine.config被处理。该文件合并后,再进行处理。从下级元素覆盖更高层次的元素(除非更高级别的元素prevents覆盖)。

They are XML files. The files for the virtual path are read in, and machine.config is treated as though it were the highest in the tree. The files are merged, then processed. Elements from lower levels override elements in higher levels (unless the higher-level element prevents overriding).

请参阅 ASP.NET配置文件层次结构和继承

这篇关于如何ASP.NET编译配置文件,如web.config文件或machine.config中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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