加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – web.config和machine.config之间的区别?

发布时间:2020-12-15 19:23:59 所属栏目:asp.Net 来源:网络整理
导读:web.config和machine.config有什么区别? 我读过: The web.config files specify configuration settings for a particular web application,and are located in the application’s root directory; the machine.config file specifies configuration sett
web.config和machine.config有什么区别?

我读过:

The web.config files specify configuration settings for a particular
web application,and are located in the application’s root directory;
the machine.config file specifies configuration settings for all of
the websites on the web server,and is located in
$WINDOWSDIR$Microsoft.NetFrameworkVersionConfig.

有没有什么我失踪或任何其他技术方面?我想更多地了解这两个文件.

解决方法

每个CLR版本都有一个machine.config文件,以及一个额外的web.config文件,我称之为“机器级web.config文件”.

另外,如你所说,每个Web应用程序也有一个web.config文件. Web应用程序中的目录也可以具有web.config文件.

现在,关键是配置文件相互继承.这意味着,Web应用程序将读取在machine.config文件和机器级web.config文件(对于其给定的框架版本)中定义的设置及其自己的web.config文件.

在machine.config中定义事物的常见用例将是在服务器上的许多应用程序之间共享值,例如连接字符串或SMTP服务器设置.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读