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 3970062
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:02:29+00:00 2026-05-20T04:02:29+00:00

I have recently tried out Ninject with the Ninject.Web.Mvc extension, and I’ve noticed something

  • 0

I have recently tried out Ninject with the Ninject.Web.Mvc extension, and I’ve noticed something peculiar and, while not breaking, confusing.

In the NinjectHttpApplication abstract class, there is a constructor defined as follows..

    /// <summary>
    /// Initializes a new instance of the <see cref="NinjectHttpApplication"/> class.
    /// </summary>
    protected NinjectHttpApplication()
    {
        this.onePerRequestModule = new OnePerRequestModule();
        this.onePerRequestModule.Init(this);
    }

I have placed a debugger breakpoint here, and this gets called a few times. I cannot find any real documentation on it. In the implementation code, there is this line that catches my eye.

            if (kernel.Settings.Get("ReleaseScopeAtRequestEnd", true))
            {
                OnePerRequestModule.StartManaging(kernel);
            }

My questions are as follows…

  • What is OnePerRequestModule
  • Why is this constructor being called multiple times?
  • What is the purpose of this StartManaging method, if the constructor is called multiple times?
  • 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-20T04:02:29+00:00Added an answer on May 20, 2026 at 4:02 am

    The OnePerRequestModule removes InRequestScope()d objects from the Kernel’s Cache upon completion of each HTTP Request.

    The NinjectHttpApplication ctor is called multiple time because IIS creates several of them. One NinjectHttpApplication can only handle one request at a time. So IIS generates (at least) one instance per thread.

    StartManaging tells all OnePerRequestModules that they shall release the InRequestScoped objects from the specified Kernel after the Request has Ended.

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

Sidebar

Related Questions

I have been recently digging into Mobile Programming, I practically tried out the J2ME
I recently tried out a Free-To-Play MMORPG game called AIKA While trying the game
I have recently tried to use the php mail function to send out confirmation
I have recently upgraded my ASP.NET MVC application from beta to version 1. And
I have recently started learning C++, but I require a compiler. I have tried
While I've been familiar with HTTPS and the concept of SSL, I have recently
I recently obtained the l0pht-CD for windows and tried it out on my PC
I have just recently started out programming for Android, and have decided that I
I have recently been trying out tmux on my server as a replacement for
We’ve recently discovered that WCF does not support timing out operations on the service

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.