Do you know 'httpHandlers' or 'httpModules' sections in web.config must contain a 'remove' or 'clear' element?

Loading last updated info...

<introEmbed
  body={<>
If web.config contains a `<httpHandlers>` or `<httpModules>` section, that section must contain a `<remove... />` or a `<clear />` element.

This basically forces developers to explicitly enable inheritance in nested virtual directories. In 99% of cases this developers won't use inheritance on these two sections, however it causes issues when somebody wants to add a module or handler to the parent virtual directory.
  </>}
/>
```aspnet
<configuration>
   <system.web>
      <httpHandlers>
         <add verb="*"
              path="*.New"
              type="MyHandler.New,MyHandler"/>
         <add verb="GET,HEAD"
              path="*.MyNewFileExtension"
              type="MyHandler.MNFEHandler,MyHandler.dll"/>
     </httpHandlers>
   <system.web>
</configuration>
```
<figureEmbed figureEmbed={ {
  preset: "badExample",
  figure: "Figure: Bad example",
  shouldDisplay: true
} } />


```aspnet
<configuration>
   <system.web>
      <httpHandlers>
         <clear/>
         <add verb="*"
              path="*.New"
              type="MyHandler.New,MyHandler"/>
         <add verb="GET,HEAD"
              path="*.MyNewFileExtension"
              type="MyHandler.MNFEHandler,MyHandler.dll"/>
     </httpHandlers>
   <system.web>
<configuration>
```
<figureEmbed figureEmbed={ {
  preset: "goodExample",
  figure: "Figure: Good example",
  shouldDisplay: true
} } />

Authors

Need help?

SSW Consulting has over 30 years of experience developing awesome software solutions.

We open source.Loving SSW Rules? Star us on GitHub. Star