IIS Config Error - This configuration section cannot be used at this path
I am getting the below error when I try to run my website.
The website is hosted on Windows 2012 R2.
Config error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Error Code : 0x80070021
Config Source:
60: <httpErrors errorMode="Detailed" />
61: <handlers>
62: <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
Below is what all I have tried:
- Installed .Net 3.5 using "Add features and roles" in IIS
-
In the applicationHost file I have made the below code changes:
Changed sections handlers', modules, anonymousAuthentication, basicAuthentication,etc overrideModeDefault from "Deny" to "Allow".
Have done "HTTP Activation" in .Net 3.5 as well as 4.5.
Below is my web config file handler code:
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
<remove name="OPTIONSVerbHandler"/>
<remove name="TRACEVerbHandler"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
Installed all the features in features windows in this path: Internet Information Service --> World Wide Web Services --> Application development features --> All but CGI have been enabled.
In feature delegation ASP was Read Only earlier, I have changed it to Read/Write
Unlocked handlers using command prompt
But I am still unable to get rid of the error. My local instance is working perfectly fine. Also, I have a development server on which this website is working, only in my production server I am getting this error.
Please help me to find out what might be causing this problem.
Solution 1:
Follow the below steps to unlock the handlers at the parent level:
1) In the connections tree(in IIS), go to your server node and then to your website.
2) For the website, in the right window you will see configuration editor under Management.
3) Double click on the configuration editor.
4) In the window that opens, on top you will find a drop down for sections. Choose "system.webServer/handlers" from the drop down.
5) On the right side, there is another drop down. Choose "ApplicationHost.Config "
6) On the right most pane, you will find "Unlock Section" under "Section" heading. Click on that.
7) Once the handlers at the applicationHost is unlocked, your website should run fine.
Solution 2:
Heres what worked for me, had a similar problem on my new laptop which had windows 10.
- Search for "Turn windows features on or off"
- Check "Internet Information Services"
- Check "World Wide Web Services"
- Check "Application Development Features"
- Enable all items under this
try again, now it should work.
Solution 3:
Most IIS sections are locked by default but you can "unlock" them by setting the attribute overrideModeDefault
from "Deny" to "Allow" for the relevant section group by modifying the ApplicationHost.config file located in %windir%\system32\inetsrv\config
in Administrator mode
Solution 4:
I came across this thread and solve the issue by the below steps, My problem may be different. Hope this can help someone.
In Turn windows feature on and off navigate to server roles and select the least below mentioned items.
Cheers!
Solution 5:
I had an applicationhost.config inside my project folder. It seems IISExpress uses this folder, even though it displays a different file in my c:\users folder
.vs\config\applicationhost.config