在 IIS 中,您可以将设置配置到网站以外的其他级别,例如,定义服务器所有站点设置的 machine.config 文件。您网站的最终配置不仅会使用您的 web.config,还会使用这些其他父级配置。
检查这些文件以查看是否有任何定义错误<defaultDocument>
:
Server-level configuration is stored in the following configuration files:
- Machine.config. This file is located in %windir%\Microsoft.NET\Framework\framework_version\CONFIG.
- Root Web.config for the .NET Framework. This file is located in %windir%\Microsoft.NET\Framework\framework_version\CONFIG.
- ApplicationHost.config. This file is located in %windir%\system32\inetsrv\config.
Site, application, and virtual and physical directory configuration can be stored in one of the following locations:
- A server-level configuration file. When configuration for a site, application, directory, or URL is stored in a server-level configuration file, you must use a location tag to specify the site, application, directory, or URL to which the configuration applies.
- A parent-level Web.config file. When configuration for an application, directory, or URL is stored in a parent-level configuration file, you must use a location tag to specify the child at which the configuration applies.
- The Web.config file for the site, the application, or the directory. When you configure settings for an application, directory, or URL, the configuration is stored in the same directory as the site, application, or directory. You do not need to use location tags.
摘自:在 IIS7 中使用配置文件