Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I figured it out with the latest version of Ninject through NuGet which now adds a class call NinjectMVC3 in a new AppStart folder in the MVC3 application.</p> <p>The code I used is as folows: In the automatically created NinjectMVC3.cs CreateKernel() method:-</p> <pre> private static IKernel CreateKernel() { // Wire it up with AOP NinjectAopConfiguration.NinjectAopConfigure(); //var kernel = new StandardKernel(); // Removed RegisterServices(NinjectAopConfiguration._container.Kernel); return NinjectAopConfiguration._container.Kernel; }</pre> <p>I also wired up Ninject for the various injection targets in RegisterServices() method.</p> <p>Next I took the sample code generated by NuGet when adding SNAP.Ninject to the MVC 3 application, renamed it NinjectAOP.cs and made it look like this:</p> <p><pre> public static class NinjectAopConfiguration { public readonly static NinjectAspectContainer _container;</p> <code> static NinjectAopConfiguration() { _container = new NinjectAspectContainer(); } public static void NinjectAopConfigure() { SnapConfiguration.For(_container).Configure(c =&gt; { c.IncludeNamespace("MyNamespace.Model.*"); c.Bind&lt;ExceptionLoggingInterceptor&gt;().To&lt;ExceptionLoggingAttribute&gt;(); }); } } </code></pre> <p>I also needed to do an assembly binding redirect for Ninject as follows because there is an assembly version conflict somewhere for Ninject:</p> <p>I hope this helps someone. </p> <p>I invite anyone to have a look and see if they can improve this please.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload