Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to fix error : This configuration section cannot be used at this path

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.

enter image description here Adding my configuration editor setting for WebSocket too.

enter image description here

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>
like image 542
Madhur Maurya Avatar asked Mar 04 '23 00:03

Madhur Maurya


1 Answers

This error cause when the section is locked at the parent level. you could follow below steps to unlock section at parent level:

  1. In the connections tree(in IIS), select your website from the connection pane.

  2. Select Configuration editor from feature view.

  3. In the window that opens, on top, you will find a drop-down for sections. Choose "system.webServer/WebSocket" from the drop-down.

  4. On the right side, there is another drop down. Choose "ApplicationHost.Config "

  5. From Action pane, you will find "Unlock Section" under "Section" heading. Click on that.

  6. Once the WebSocket at the applicationHost is unlocked, restart IIS and run site.

like image 175
Jalpa Panchal Avatar answered Mar 06 '23 15:03

Jalpa Panchal