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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:52:51+00:00 2026-05-23T19:52:51+00:00

I have a web application which was using Asp.net MVC2 . I Upgraded it

  • 0

I have a web application which was using Asp.net MVC2. I Upgraded it to MVC 3 and now I found that OutputCache feature is not working any-more. I created a simple Test action as shown below.

 [OutputCache(Duration = 1000000, VaryByParam = "none")]
 public virtual ActionResult CacheTest(string name)
  {
     string message = string.Format("{0}: Time is {1}", name, DateTime.Now.ToLongTimeString());
     ViewData.Add("Message", message);
     return View();
  }

This always gives the current time which shows that it is not cached. Am I missing something here?

More Info: If i create a new Mvc3 app it works fine. Its only in the upgraded app that I have this issue.

Update: I am also using Ninject. If I stop using Ninject OutputCache starts working.

public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}.aspx/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }

        protected void Application_Start()
        {
            RegisterDependencyResolver();

            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }

        protected void RegisterDependencyResolver()
        {
            var kernel = CreateKernel();
            DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));
        }

        protected IKernel CreateKernel()
        {
            return new StandardKernel();
        }
    }
  • 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-23T19:52:53+00:00Added an answer on May 23, 2026 at 7:52 pm

    The correct and recommended way to use Ninject in ASP.NET MVC 3 is the following:

    1. Install the ninject.mvc3 NuGet package. This will ensure that you get the latest version compatible with ASP.NET MVC 3.

    2. Once installed this will add a App_Start/NinjectMVC3.cs file to your project and it is inside the RegisterServices method that you will register your Ninject modules:

      private static void RegisterServices(IKernel kernel)
      {
          var modules = new INinjectModule[]
          {
              // your modules here
          };
          kernel.Load(modules);
      }        
      
    3. Remove all Ninject specific code from your Global.asax including any NinjectDependencyResolver.

    Try following those steps and maybe your problem will get fixed.

    • 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 web service that I'm using for a web application which
I have created a new MVC2 project using the ASP.NET MVC2 Web Application, which
We have an ASP.net 2.0 web application which is using themes set on the
I have a asp.net web application which is using membership for authentication and authorization.
So I have an ASP.NET/VB web application in which I'm using both RequiredFieldValidators and
I have developed a Web Application using ASP.Net with Microsoft Access as database. Now
I have a location using our ASP.NET 4.0 web application which was running fine
I am using VS2005 ASP.NET 2.0. I have a web application which uses Active
I'm in the process of building my first web application using ASP.NET MVC 2
I'd like to implement ASP.Net MVC application which could have controllers, views and content

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.