0

there is a web.config:

<configuration>
  <system.webServer>
    <handlers>
      <remove name="something" />
      <add name="target" path="*" verb="*" type="Custom.Handler"/>
    </handlers>
  </system.webServer>
</configuration>

And I need to obtain, in Custom.Handler class, name of the add element, "target" in the example. Is it possible?

Andrej B.
  • 187
  • 1
  • 5
  • 14
  • Does this answer your question? [Reading settings from app.config or web.config in .NET](https://stackoverflow.com/questions/1189364/reading-settings-from-app-config-or-web-config-in-net) – ahmet gül Aug 10 '22 at 11:51
  • No, it does not. I'm able to read whole system.webServer section by ConfigurationManager.GetSection, but I can't get handlers or handler names from it. I need exactly name of added handler. – Andrej B. Aug 10 '22 at 12:07
  • Try this in that case : https://stackoverflow.com/a/58437486/8763644 – ahmet gül Aug 10 '22 at 12:15
  • It's an option, but also I want to know if is there some option without such extra parsing. – Andrej B. Aug 10 '22 at 12:51

0 Answers0