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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:58:24+00:00 2026-05-31T15:58:24+00:00

My ASP.NET MVC 3 application uses Ninject IoC container. One of controllers depends on

  • 0

My ASP.NET MVC 3 application uses Ninject IoC container. One of controllers depends on a data provider, that needs to start caching potentially required stuff when the web site starts, not when the controller is created on request and data is needed right a way.

So for this, I need to ask Ninject to create a singleton scope instance of my dependency, that it will that feed on requests on site start.

How can I do this?

  • 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-31T15:58:26+00:00Added an answer on May 31, 2026 at 3:58 pm

    I would just performing whatever operation in global.asax on application started override that NinjectHttpApplication provides. If you are using a regular HttpApplicaiton (without the NinjectHttpApplication override) in your global.asax, then just use the regular HttpApplication_Start event to do your initialisation of the cache. Touching the IoC container in this context is acceptable as it is the composite root of your application. So I guess something like:

    Bind<IProvider>().To<CacheProvider>().InSingletonScope(); //<in binding module
    
    Kernel.Get<IProvider>().SetupCache() //<in global.asax
    

    I dont really see any need for it to be more complicated than this… I could be wrong though.

    If you can provide more detail about the provider, i can give a more specific suggestion.

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

Sidebar

Related Questions

I have an ASP.NET MVC 3 application that uses the Ninject.MVC3 extension to setup
I have an asp.net mvc application that uses web service. I have various controllers
I have an ASP.NET MVC application that uses Fluent NHibernate and AutoMapper. I am
I have an ASP.NET MVC application that uses Linq to SQL repositories for all
I've a very basic ASP.NET MVC application that uses the default routing. Now I
We are developing an ASP.NET MVC Application that currently uses it's own database ApplicationData
I have an application (ASP.NET MVC) that uses a Next New method to get
Is there any good/simple asp.net MVC application that uses NoSQL database(cassandra). Any suggestion.
My ASP.NET MVC 2 application uses Entity Framework 4.0 for the data model. Following
I have an ASP.Net MVC application that uses SQL Server 2005 via NHibernate. I

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.