J'essaie d'utiliser Ninject 2.0 avec une application Web Asp .Net 3.5. Voici les DLL et ses versions que j'utilise.Utilisation de Ninject 2.0 avec ASP .Net 3.5
- Ninject.dll - v2.0.0.0
- Ninject.Extensions.Logging.dll v2.0.0.0
- Ninject.Web.dll v1.0.0.0
En mon global.ascx.cs j'ai la méthode suivante.
protected override IKernel CreateKernel()
{
IKernel kernel = new StandardKernel();
kernel.Bind<IDataAccess>().To<DataAccessEntBlock>().InSingletonScope();
return kernel;
}
Lorsque j'exécute l'application, j'obtiens l'erreur suivante.
Error activating ILoggerFactory
No matching bindings are available, and the type is not self-bindable.
Activation path:
1) Request for ILoggerFactory
Suggestions:
1) Ensure that you have defined a binding for ILoggerFactory.
2) If the binding was defined in a module, ensure that the module has been loaded into the kernel.
3) Ensure you have not accidentally created more than one kernel.
4) If you are using automatic module loading, ensure the search path and filters are
correct.
je ne comprends pas, même si je ne suis pas en train d'enregistrer Logger, il semble qu'il essaie de créer son propre. Comment puis-je résoudre cette erreur? Dois-je utiliser l'extension Logger de Ninject?
Merci GK
Veuillez corriger le formatage (les types génériques sont manquants, utilisez l'aperçu!). Première supposition serait de chercher la suggestion 2 .. –