IIS Config Error - This configuration section cannot be used at this path
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Understanding IIS Configuration Errors
Internet Information Services (IIS) is a powerful, extensible web server created by Microsoft for use with Windows NT family. One common configuration error encountered when working with IIS is the following: "This configuration section cannot be used at this path."
This error occurs due to restrictions placed on configuration settings, particularly when using IIS’s distributed configuration system. Understanding this error involves diving into IIS’s architecture and the distinctions between different configuration files.
Key Concepts Behind the Error
IIS Configuration Architecture
IIS uses a hierarchical configuration system, primarily managed through two types of configuration files:
- **
ApplicationHost.config**:- This file is the primary configuration file for IIS, which centralizes settings for web applications hosted on the server.
- It includes global settings and is located at
%windir%\System32\inetsrv\config\applicationHost.config.
- **
Web.config**:- It is a file-based configuration used for a per-application basis.
- These files can be nested, allowing specific directories to have their unique settings.
- Located usually within the application’s root directory.
Configuration Hierarchy and Overrides
- The IIS configuration system is hierarchical, meaning settings defined higher in the hierarchy (e.g.,
ApplicationHost.config) can be overridden by files lower in the hierarchy (Web.config). - However, not every configuration section is allowed to be defined in a
Web.configfile. Some sections are restricted due to security and design decisions and can only be applied at the server or site level withinApplicationHost.config.
Common Misconfigurations Leading to Error
- Restricted Sections:
- Examples of configuration sections that may not be applicable at a directory level in
Web.config:- ``
<system.webServer>`` for certain detailed settings. - ``
<windowsAuthentication>`` since authentication settings could require higher permissions.
- Ensure that such settings are put in
ApplicationHost.configor an appropriate level.
- Incorrect Location:
- Placing server-level configurations in directories not permitted for these settings is a common error source.
- Ensure configurations adhere to IIS’s schema and documentation for permissible locations.
- Permissions and Access Control:
- Sometimes, the physical path might not have the necessary read/write permissions set, leading to this error.
- Ensure that the appropriate user accounts have access to the directory containing the
Web.config.
Troubleshooting the Error
Identifying the Issue
- Configuration Logging:
- IIS keeps detailed logs of errors in the Event Viewer under “Windows Logs ➔ System”. Use these logs to identify and rectify misconfigurations.
- IIS Manager:
- The IIS Manager can help visualize where configuration changes are being applied and whether they conflict with higher-level settings.
Practical Correction Steps
- Move the Configuration:
- If the configuration section is not allowed in
Web.config, migrate it toApplicationHost.config.
- Validate Permissions:
- Use the
IIS_IUSRSgroup or the application pool identity to ensure directories have the correct access permissions.
Summary Table
| Element | Description |
**ApplicationHost.config | |
| ** | |
**Web.config | |
| ** | |
| Troubleshooting Actions | |
2. Ensure correct user permissions are applied. | |
<br> | |
| --- | --- |
Additional Tips
- Documentation: Always check the official IIS documentation for specific configuration details and best practices.
- Community Support: Forums, such as Microsoft Q&A, are valuable resources for real-world troubleshooting advice.
Conclusion
The "This configuration section cannot be used at this path" error is a reflection of IIS's robust and security-centric design which aims to enforce configuration sanctity. Recognizing and adhering to the hierarchical nature of IIS configurations will not only prevent this error but also improve the robustness and security of web applications.

