I have a global.asax and I would like to check in the Application_Start method if a IHttpHandler with a certain name is registered. How can I do this?
The handler can be declared in the apps own web.config or one of another virtual parent directories or the machine.config.
I’m not aware of a public method to do what you’re asking for.
I think the code you want is either HttpContext.Current.ApplicationInstance.GetHandlerMapping(), .MapHttpHandler() or .MapIntegratedHttpHandler(), but they are private or internal methods. However, you should be able to use reflection to call them.
An alternative would be some trial-and-error type testing (try to request a target that should be routed to the expected handler, and see what happens in several place, such as in the MapRequestHandler event in an HttpModule — but I think Application_Start is too early for that.