In IIS7 we can tell a module to run for managed content (thus speeding up static content serving) by:
<modules> ... <add name="WhateverName" type="WhateverType" preCondition="managedHandler" ... </modules>
But. This works fine and dandy as long as there's also a file name (with extension) in the requested URL. If it's omitted it IIS7 will think you want static content and managed modules won't run.
http://localhost/ <-- this one will skip managed handlers http://localhost/default.aspx <-- this one will run them
If I manually set IIS7 default document, so the first one will be
default.aspx, I can see no difference. To me this looks, walks and sounds like a bug. And it is a bug! Why? Because when I request for the first one, it is a managed request, isn't it. Of course it is. But IIS7 treats it as a static request. So? It's a bug. This request should be treated as managed.
How can I convince IIS7 to run managed handlers for URL requests without file names inside?
Help with thinking
Let me help you a bit with thinking: If I'd reorder
system.webServer/handlers, I'm sure could solve this. Before the last
StaticFile handler that points to
DirectoryBrowsingModule I should be running integrated asp.net handler on Directory requests. Or write my own handler, that would append default document to any directory request. I'm pretty sure one of these should solve it. But how would I have to configure/develop it?