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 StaticFileModule, DefaultDocumentModule and 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?

Is this StaticFile handler (or maybe module) behaviour? What about UrlRewriting that runs before it?
–
Robert KoritnikAug 12 '09 at 19:26

I don't think it has anything to do with the handler itself - it is because you are putting the precondition on adding your module. Not sure what would happen if you did a URLRewrite on it.
–
MattBAug 12 '09 at 21:36

It is a bug. If I request a path without filename at the end, DefaultDocument presence should determine whether it's a managed or static request. It shouldn't be just static...
–
Robert KoritnikSep 2 '09 at 8:16