Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6917419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:43:41+00:00 2026-05-27T09:43:41+00:00

Creating custom IHttpModules, I have realized that the requests for static files (e.g.: .css

  • 0

Creating custom IHttpModules, I have realized that the requests for static files (e.g.: .css and .js files) are hitting the managed modules. Probably pictures have the same problem. Shouldn’t IIS bypass ASP.NET for files that exists in the filesystem?

For example:

public class MyModule:IHttpModule
{
    public void Dispose(){ }

    public void Init(HttpApplication context)
    {
        context.BeginRequest += (o, e) => Debug.Print("Request: " + HttpContext.Current.Request.RawUrl);
    }
}

And I declare it this way:

<modules runAllManagedModulesForAllRequests="true">
  <add name="MyModule" preCondition="managedHandler" type="MVCX.Modules.MyModule, MVCX"/>
</modules>

But, even using the precondition I can see how the static files goes through the module:

Request: /MVCX/
Request: /MVCX/Content/Site.css
Request: /MVCX/Scripts/jquery-1.4.4.min.js

I have tried to ignore the rules for static files, but it does not make a difference:

routes.IgnoreRoute("{Content}/{*pathInfo}");
routes.IgnoreRoute("{Scripts}/{*pathInfo}");

Is this the usual? Or am I missing something here? As far as I know, if the static file request should be answered by IIS. If my managed module is being hit, means that a CLR ThreadPool thread is handling that request, right?

Regards.

UPDATE:

I have disabled the “runAllManagedModulesForAllRequests”:

<modules runAllManagedModulesForAllRequests="false">
      <add name="MyModule" preCondition="managedHandler" type="MVCX.Modules.MyModule, MVCX" />
</modules>

And everything seems to work just fine, but I have found this article: http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html that recommends remove and readd the “UrlRoutingModule-4.0” module with an empty precondition.

I my machine, the adding of that module is in the root web.config, and it has already an empty preCondition:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config>type machine.config | find "UrlRouting"


C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config>type web.config | find "UrlRouting"
            <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config>

So now I am a little bit confused, what is the status of this parameter? Should I use it or shouldn’t? why does it come as “true” by default?

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:43:42+00:00Added an answer on May 27, 2026 at 9:43 am

    I my machine, the adding of that module is in the root web.config, and it has already an empty preCondition

    Perfect. That means this module will always run which is required for MVC as it uses extensionless urls.

    So now I am a little bit confused, what is the status of this parameter? Should I use it or shouldn’t? why does it come as “true” by default?

    Because extensionless url support is new in IIS7 SP1 and IIS7.5 SP1.
    It is available for IIS7 as a patch that you have to request and install.
    You will find it here with complete answers to your questions:
    http://support.microsoft.com/kb/980368

    Why this parameter comes to true by default ? Because VS2010 was shipped before IIS7 SP1.
    Maybe it is at false in new MVC projects in VS2010SP1 ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mastered creating custom data types and adding fields with CCK. Then I
I am creating custom membership provider for my asp.net application. I have also created
I am just learning about app.config in respect of creating custom sections. I have
In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch
I'm looking for a tutorial that explains creating custom usercontrols in WPF. I want
I am creating custom Swing components and want to provide a UI that looks
I'm creating custom control that contain multiple parts. Inside template creation I'm subscribing for
I am creating custom images that I later convert to an image pyramid for
I'm learning about creating custom routes in ASP.NET MVC and have hit a brick
I have a Rails blog using friendly_id for creating custom urls. The blog has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.