IIS Config Error - This configuration section cannot be used at this path
Asked Answered
A

9

86

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:

  1. Installed .Net 3.5 using "Add features and roles" in IIS
  2. In the applicationHost file I have made the below code changes:

    Changed sections handlers', modules, anonymousAuthentication, basicAuthentication,etc overrideModeDefault from "Deny" to "Allow".

  3. 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>
  1. 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.

  2. In feature delegation ASP was Read Only earlier, I have changed it to Read/Write

  3. 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.

Alum answered 10/12, 2015 at 10:50 Comment(2)
Have you tried to remove the handler from IIS console interface in your application and see what changed in your web.config ?Communicant
When I double click on handler mapping under IIS in features view for my website, I get the same 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".Alum
A
184

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.

Alum answered 11/2, 2016 at 6:37 Comment(6)
Worked like a charm. Is there a reason why these "features" are locked?Grade
I am not sure why this happens. For me, only the servers at production level were locked, rest were by default unlocked.Alum
I have four boxes, all new, and installed a single application on all four. Only one of four had this issue. This answer worked perfectly.Stines
Thank you! This solved my issue. Although, the drop down in step 5 didn't exist for me (IIS 10 on Win 10), and it wasn't the system.webServer/handlers section that was locked for me. It turned out to be the defaultPath attribute under the system.webServer/httpErrors section.Silicosis
How many window you have opened? what is the name of window that opens? at the top there are 2 dropdowns!Sclera
Confirmed, still works in 2022Tributary
B
81

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.

Blowhole answered 11/9, 2016 at 14:19 Comment(7)
I'm on Windows 10, and one of the recent updates (Anniversary Update probably) wiped out all my IIS websites and settings and completely disabled IIS on my machine! Your solution was quick and it fixed my issues. Thanks!Andel
New laptop with Win10, and I sloppily just checked the root node of "Internet Information Services" in "Turn windows features on or off". This did the trick.Skippet
when I transferred all my data to new laptop, it didn't work. your solution helped. Thanks.Turbit
Works like charm for me thanks Yasser but don't know what I did. Can you please explain this what changes you made?Crapshooter
Worked like a charm for me on windows 10Poultice
worked for my Windows 10 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".Immunogenetics
specifically the ASP.NET x.x itemBoddie
B
23

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

enter image description here

Brocket answered 22/5, 2017 at 1:55 Comment(2)
The only thing that worked for me. I had looked though the Configuration Editor in IIS for any section that was marked as locked with a lock icon and couldn't find any.Lamm
This also worked in windows server 2012 r2Lassie
T
14

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.

enter image description here

Cheers!

Tailor answered 23/10, 2018 at 13:32 Comment(0)
T
7

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

Tenterhook answered 22/3, 2017 at 16:41 Comment(0)
B
2

When I tried these steps I kept getting error:

  1. Search for "Turn windows features on or off"
  2. Check "Internet Information Services"
  3. Check "World Wide Web Services"
  4. Check "Application Development Features"
  5. Enable all items under this

Then i looked at event viewer and saw this error:Unable to install counter strings because the SYSTEM\CurrentControlSet\Services\ASP.NET_64\Performance key could not be opened or accessed. The first DWORD in the Data section contains the Win32 error code.

To fix the issue i manually created following entry in registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ASP.NET_64\Performance

and followed these steps:

  1. Search for "Turn windows features on or off"
  2. Check "Internet Information Services"
  3. Check "World Wide Web Services"
  4. Check "Application Development Features"
  5. Enable all items under this
Blackmarketeer answered 12/2, 2019 at 19:33 Comment(0)
C
1

I think the better way is that you must remove you configuration from your web.config. Publish your code on the server and do what you want to remove directly from the IIS server interface.

Thanks to this method if you sucessfully do what you want, you just have to get the web.config and compare the differences. After that you just have to post the solution in this post :-P.

Communicant answered 11/12, 2015 at 9:31 Comment(2)
I tried removing the handler section from the Web.Config file and publishing. For some reason, I was able to get the data but when I am doing Post/Put operation, it is popping up error 404, and saying not found. I am not sure why this happening. Any ideas?Alum
Ok so now your website works. It is a good point :-). Now I think you must had more details about what you want to do ? Why you have to remove this handler ?Communicant
B
1

Below is what worked for me:

  1. In IIS Click on root note "LAPTOP ____**".
  2. From option being shown in middle tray, Click on Configuration editor at bottom.
  3. In Top Drop Down select "system.webServer/handlers".
  4. At right window in Section Unlock Section.
Byebye answered 16/8, 2020 at 5:19 Comment(0)
W
0

Click on your project properties, go to the web section, from the Servers section, change from IIS express to Local IIS, it will create a virtual directory for you

Windage answered 6/7, 2017 at 15:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.