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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:13:05+00:00 2026-05-23T07:13:05+00:00

I upgraded from ninject 2.0 to 2.2 and nothing works anymore. When I use

  • 0

I upgraded from ninject 2.0 to 2.2 and nothing works anymore.

When I use nuget it makes this

[assembly: WebActivator.PreApplicationStartMethod(typeof(MvcApplication3.App_Start.NinjectMVC3), "Start")]
[assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(MvcApplication3.App_Start.NinjectMVC3), "Stop")]

namespace MvcApplication3.App_Start
{
    using System.Reflection;
    using Microsoft.Web.Infrastructure.DynamicModuleHelper;
    using Ninject;
    using Ninject.Web.Mvc;

    public static class NinjectMVC3 
    {
        private static readonly Bootstrapper bootstrapper = new Bootstrapper();

        /// <summary>
        /// Starts the application
        /// </summary>
        public static void Start() 
        {
            DynamicModuleUtility.RegisterModule(typeof(OnePerRequestModule));
            DynamicModuleUtility.RegisterModule(typeof(HttpApplicationInitializationModule));
            bootstrapper.Initialize(CreateKernel);
        }

        /// <summary>
        /// Stops the application.
        /// </summary>
        public static void Stop()
        {
            bootstrapper.ShutDown();
        }

        /// <summary>
        /// Creates the kernel that will manage your application.
        /// </summary>
        /// <returns>The created kernel.</returns>
        private static IKernel CreateKernel()
        {
            var kernel = new StandardKernel();
            RegisterServices(kernel);
            return kernel;
        }

        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {

        }        
    }
}


I use this






     /// <summary>
            /// Application_Start
            /// </summary>
            protected void Application_Start()
            {

                // Hook our DI stuff when application starts
                IKernel kernel = SetupDependencyInjection();

            }


            public IKernel SetupDependencyInjection()
            {
                IKernel kernel = CreateKernel();
                // Tell ASP.NET MVC 3 to use our Ninject DI Container
                DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));

                return kernel;
            }

            protected IKernel CreateKernel()
            {
                var modules = new INinjectModule[]
                                  {
                                     new NhibernateModule(),
                                     new ServiceModule(),
                                     new RepoModule()
                                  };


  public class NinjectDependencyResolver : IDependencyResolver
    {
        private readonly IResolutionRoot resolutionRoot;

        public NinjectDependencyResolver(IResolutionRoot kernel)
        {
            resolutionRoot = kernel;
        }

        public object GetService(Type serviceType)
        {
            return resolutionRoot.TryGet(serviceType);
        }

        public IEnumerable<object> GetServices(Type serviceType)
        {
            return resolutionRoot.GetAll(serviceType);
        }
    }

So when I try to use my way(what worked before the changes) when I load it up now I get some no parameterless controller.

When I use their I get

Error occured: Error activating SomeController
More than one matching bindings are available.
Activation path:
  1) Request for SomeController

Suggestions:
  1) Ensure that you have defined a binding for SomeController only once.
  • 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-23T07:13:05+00:00Added an answer on May 23, 2026 at 7:13 am

    I hope you know that there is a documentation at https://github.com/ninject/ninject.web.mvc/wiki/Setting-up-an-MVC3-application where this question is explained.

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

Sidebar

Related Questions

I upgraded from MacOS X 10.6 (Snow Leopard) to 10.7 (Lion) this morning, and
I've just upgraded from MRI-1.8.7 to MRI-1.9.1 and heard about this lighthouse ticket which
We've recently upgraded from Visual SourceSafe to SVN based on recommendations on this site.
I upgraded from async_sinatra 0.5.0 to 1.0 because the latter fixed this problem So
Since I've upgraded from delphi 5 to XE I'm struggling to use specific Dlls
I recently upgraded from MVC2 to MVC3. We used to use the Spark view
I've just recently upgraded from ABCPdf 6 to ABCPdf 8.1. I've got this webpage
Recently, I upgraded one of my MVC3 projects from Ninject 2 to Ninject 3.
I've just upgraded from XAMPP 1.7.3 to 1.8.0, this included quite a few changes
We have recently upgraded from SQL Server 2005 to SQL Server 2008 (R2, SP1).

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.