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.Net\Framework\Version\Config.
有没有什么我失踪或任何其他技术方面?我想更多地了解这两个文件.
解决方法
每个CLR版本都有一个machine.config文件,以及一个额外的web.config文件,我称之为“机器级web.config文件”.
另外,如你所说,每个Web应用程序也有一个web.config文件. Web应用程序中的目录也可以具有web.config文件.
现在,关键是@R_502_382@相互继承.这意味着,Web应用程序将读取在machine.config文件和机器级web.config文件(对于其给定的框架版本)中定义的设置及其自己的web.config文件.
在machine.config中定义事物的常见用例将是在服务器上的许多应用程序之间共享值,例如连接字符串或SMTP服务器设置.