when use portable.ninject in xamarin.forms app, instantiating standardkernel results in notimplementedexception
.
i can consistently replicate problem follows:
- create xamarin.forms application (in vs2017: cross platform app (xamarin))
- configure use pcl
- i'm interested in android , sake of brevity, removed other platform projects.
- add nuget package portable.ninject pcl , android platforms
then, in app.xaml.cs try following:
public app() { initializecomponent(); //ommitting ninjectmodules brevity var kernel = new ninject.standardkernel(); //exception thrown here mainpage = new navigationpage(new mainview()); }
what missing here?
currently i'm using portable.ninject version 3.3.1. tried xlabs.ioc.ninject package (which uses portable.ninject) , got same result.
for experience same problem:
tldr; clean projects, , rebuild.
explanation: @ first had added ninject pcl, , had forgotten add android project. although added ninject library android project afterwards, still result in exception being thrown.
the solution clean projects , rebuild them. it's easy!
Comments
Post a Comment