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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:06:45+00:00 2026-05-24T01:06:45+00:00

Previously I registered dependencies in IoC container at application start setting controller factory. But

  • 0

Previously I registered dependencies in IoC container at application start setting controller factory. But now I need to register some dependencies per request. Are there any ways to make it in ASP.NET MVC 3?

  • 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-24T01:06:46+00:00Added an answer on May 24, 2026 at 1:06 am

    Generally, even every basic IoC container supports object lifecycle management in some way.

    My favorite container is Ninject 2.0 which seemlessly integrates with ASP.NET MVC 3. It’s available as a NuGet package called Ninject.MVC3.

    In the RegisterServices(IKernel) method, you can define a scope for each type to resolve. The following code configures Ninject to return the same single instance of SomeImplementation when ISomeInterface is being resolved:

    /// <summary>
    /// Load your modules or register your services here!
    /// </summary>
    /// <param name="kernel">The kernel.</param>
    private static void RegisterServices(IKernel kernel)
    {
        kernel.Bind<ISomeInterface>().To<SomeImplementation>().InRequestScope();
    }
    

    Ninject lets you choose from one of the following available scopes:

    • InRequestScope()
    • InThreadScope()
    • InSingletonScope()
    • InTransientScope()

    Nate Kohari wrote a blog post about that topic called Cache-and-Collect Lifecycle Management in Ninject 2.0 — you would definitely want to check that out!

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

Sidebar

Related Questions

Previously I have only really worked on applications, but now I am trying to
Previously I've asked about inserting a column into a dataset . I now have
Previously we had desktop applications but given the fact that accessing the server (either
Previously I've been using some older version of django-registration which seems to be deprecated
I posted a similar question previously, but none of the answers worked and I've
We have a fairly complex application that was previously using WebForms. We are in
Ok after my previous post, i have made some progress, yet still i need
I have posted a question on here previously asking similar advise, but this project
Scenario - I am writing a console application. Need to use a certain DLL
iam having controller like below which is not registered in routes table public class

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.