Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come there's no IKernel implementation in Ninject.Portable

I use and fancy Ninject alot.

I wonder why there is no "BasicKernel" in Ninject.Portable?

Is implementing IKernel require any call that PCLs don't contain?

I'm talking about simple scenario (about: Bind<If1>().To<Class1>() and Get<If1>() )?

like image 832
Dejan Dakić Avatar asked Jul 15 '14 11:07

Dejan Dakić


1 Answers

The PCL version of Ninject is split into two libraries, Ninject.dll and Ninject.Common.dll as some of the code is platform-specific. Ninject cannot exist without its platform code.

In order to use Ninject, you need to add the Portable.Ninject Nuget to both your portable library and to your main app/exe. Adding the package into the main app/exe is what brings in both required files.

As an aside, I'm reworking the package to use the PCL "Bait and Switch" technique, so there's only a single Ninject.dll file. That'll enable you to reference any of it within a PCL, but still requires the NuGet to be referenced by the app/exe to get the "real" implementation instead of a façade.

like image 86
Claire Novotny Avatar answered Oct 04 '22 20:10

Claire Novotny