Closed thomen closed 12 years ago
This means that the DataAnnotationsModelValidatorProvider is removed by someother library or you use App_Start and derive from NinjectHttpApplication at the same time.
How do I find out / fix if DataAnnotationsModelValidatorProvider was removed?
If I remember correctly this can occur if you derive from NinjectWebApplication in addition to using App_Start.
Have you verified that you don't derive from NinjectWebApplication?
2012/11/19 Saulo Vallory notifications@github.com
How do I find out / fix if DataAnnotationsModelValidatorProvider was removed?
— Reply to this email directly or view it on GitHubhttps://github.com/ninject/ninject.web.mvc/issues/24#issuecomment-10503709.
Yes. That's why I asked about the DataAnnotationsModelValidatorProvider removed thing :/
Couldn't solve the issue, so I uninstalled Ninject and started adding todo's where I'm hard coding the instantiation to deal with this later. Any help will be much appreciated!
Found the problem! I have tree projects in my solution (Domain, Infra and UI). I accidentally installed Ninject in two of them (infra and UI) which created two NinjectWebCommon
classes. This was the cause of the issue. Once I removed the ninject package from infra, the problem was solved. :)
@svallory thank you for the update! This helped me
The easiest solution is to delete the NinjectWebCommon.cs class created under the App_Start directory and allow the MvcApplication inheriting from NinjectHttpApplication to let Ninject take care of calling your NinjectModule modules where you register your bindings.
@svallory just passing by to thanks. I'm actually new to Ninject and was getting this Exception while loading my application. Removed duplicated NinjectWebCommon class and worked! ;)
@svallory This was Helpfull Thanks ^^.
System.Linq.Enumerable.Single(IEnumerable`1 source) +379 Ninject.Web.Mvc.NinjectMvcHttpApplicationPlugin.Start() in c:\Projects\Ninject\ninject.web.mvc\mvc3\src\Ninject.Web.Mvc\NinjectMvcHttpApplicationPlugin.cs:53
I cannot seem to get this up and running. I've followed the instructions to the letter..
nothing changed in global I'm using the App_Start folder
[assembly: WebActivator.PreApplicationStartMethod(typeof(EFWebApp.Web.App_Start.NinjectWebCommon), "Start")] [assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(EFWebApp.Web.App_Start.NinjectWebCommon), "Stop")]
namespace EFWebApp.Web.App_Start { using System; using System.Web;
}