runAllManagedModulesForAllRequests=”true” was something I added to all my web.config files for ASP.NET MVC when I wanted to run the web app in deployment on my Windows Server 2008 box.

I wanted to have Glimpse configured for the project though, and as this needed the ability to add (another) module in web.config, I decided to figure out why runAllManagedModulesForAllRequests was needed in the first place, understand a bit more about it, and then hopefully fix it properly as it always seemed a bit of a hack.

Thankfully there is some good advice here:

Don’t use runAllManagedModulesForAllRequests=”true” when getting your MVC routing to work

And a hotfix from Microsoft so you do not need to do any hacking with web.config:

Edit 21/8/2013

Turns out applying the above fix might cause some issues if you then have a . in a url slug, eg /blog/

The .com part causes an issue.

The below link to a stackoverflow answer shows how to add a httphandler that solves this problem…

ASP.NET MVC RenderSection

This post is as much for my own use as others as I’m always¬†forgetting how to add sections to an mvc masterpage.

In the master page add your subsection using:


and in the views implement this section using:

@section Footer {
<p>This is my footer</p>

You can make the section optional in your view:

<footer>@RenderSection(“Footer”, required: false)</footer>