Error loading module 'Ninject.Web.Mvc.MvcModule' of type MvcModule Another module (of type MvcModule) with the same name has already been loaded

by sunil ravulapalli /5. March 2013 00:58 /.net-tools /Comments (2)

Error loading module 'Ninject.Web.Mvc.MvcModule' of type MvcModule
Another module (of type MvcModule) with the same name has already been loaded
Suggestions:
 1) Ensure that you have not accidentally loaded the same module twice.
 2) If you are using automatic module loading, ensure you have not manually loaded a module
    that may be found by the module loader.

While using NINJECT, If you are getting this error when using 

kernel.Load(AppDomain.CurrentDomain.GetAssemblies());

one possible solution might be is to do it this way, by listing out the dll's individually

kernel.Load("projectname.data.dll");

kernel.Load("projectname.service.dll");

I haven't figured out why the modules were loading more than once, but the above work around does achieve the "loose coupling" we seek.

 

 

blog comments powered by Disqus