I am getting an error
This configuration section cannot be used at this path. This happens when the section is locked at a parent level.
due to config entry at line 27 given below. I tried fixing it by unlocking the section websocket in Configuration Editor in IIS but it didn't work. The service works fine as soon as I remove line 27.
26: </handlers>
27: <webSocket enabled="true" />
28: </system.webServer>
Below is complete Error Message:
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".
Providing image for reference.
Adding my configuration editor setting for WebSocket too.
The section in web.config is below:
<system.webServer>
<webSocket enabled="true" />
<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>
</system.webServer>
This error cause when the section is locked at the parent level. you could follow below steps to unlock section at parent level:
In the connections tree(in IIS), select your website from the connection pane.
Select Configuration editor from feature view.
In the window that opens, on top, you will find a drop-down for sections. Choose "system.webServer/WebSocket" from the drop-down.
On the right side, there is another drop down. Choose "ApplicationHost.Config "
From Action pane, you will find "Unlock Section" under "Section" heading. Click on that.
Once the WebSocket at the applicationHost is unlocked, restart IIS and run site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With