Tuesday, 15 January 2013

asp.net web api - Error loading Ninject component ICache -



asp.net web api - Error loading Ninject component ICache -

i using ninject in asp.net web api project , have started receiving intermittent ninject error:

"error loading ninject component icache no such component has been registered in kernel's component container."

i'm using:

ninject 3.0.1.10 ninject.mvc3 3.0.0.6 ninject.web.common 3.0.0.7

they brought project nuget load modules in iocconfig.registerioc , have made no other changes or tweaks.

it may unrelated problem started occurring @ around same time started injecting ikernel 1 of constructors. didn't set binding having read "special resolver".

i have read through number of similar questions on here:

ninject + "error loading ninject component icache"

ninject , childkernel in mvc3 project: "error loading ninject component icache"

randomly-occurring ninject exception: "error loading ninject component icache"

although in each of these cases op has same error me solution not appropriate - not creating kid kernels , i'm not using bugged version of ninject.

found solution , thought share.

the problem was using ninject.mvc3 seems wrong bundle web-api.

instead need utilize ninject.web.webapi-rc bundle described post:

http://www.eyecatch.no/blog/2012/06/using-ninject-with-webapi-rc/

steps followed prepare are

uninstalled ninject.mvc3 , ninject.web.common delete of ninject files app_start folder. install ninject.web.common , ninject.web.webapi-rc nuget load modules in ninjectwebcommon.registerservices()

asp.net-web-api ninject

No comments:

Post a Comment