0

Can any one share me how to implement nInject DI into WCF service.

Latest packages are this -

<package id="Ninject" version="3.2.2.0" targetFramework="net40" />
<package id="Ninject.Extensions.Wcf" version="3.2.1.0" targetFramework="net40" />

I tried to achieve using above two packages but not worked.

Can any one share me how i should use above package and implement WCF service - DI and here, versions are 3.2.2.0,3.2.1.1.

Tried using - http://www.aaronstannard.com/post/2011/08/16/dependency-injection-ninject-wcf-service.aspx link approach. But, here also i faced an issue, unable to resolve reference for - NinjectWcfApplication It looks like, there are some changes into WCF extension package so, above link not worked.

Please help me how I could achieve WCF service to have DI with nInject?

nemesv
  • 138,284
  • 16
  • 416
  • 359
user3711357
  • 1,425
  • 7
  • 32
  • 54
  • Is there anything that googling "ninject wcf tutorial" cannot solve? This is no tutorial site, this site is for asking very specific questions. Your question is basically the need for a tutorial because the first one you found did not work. Try the next one. – nvoigt Jul 05 '14 at 10:25
  • Ya, i tried that.. but each of the sample application or tutorial use below package - ` ` and this package is not able to download from nuget, nuget gives latest package that is new version 3.2.2.0,3.2.1.1 and it does not resolve `NinjectWcfApplication` class – user3711357 Jul 05 '14 at 16:36
  • 1
    And did you put "NinjectWcfApplication" into google? Because the very first hit I get is a StackOverflow post describing your problem and a solution. – nvoigt Jul 05 '14 at 16:46
  • Thank You !. I tried before but, confuse and stick with exact name `nInjectWCFApplicationo` class and not follow its base `HttpApplication`. Now, it is changed to `Ninject.Web.Common.NinjectHttpApplication` and focused as you suggested. Thank You. You can add as answer.i will mark. thanks. http://stackoverflow.com/questions/10390809/upgrading-ninject-ninject-wcf-extensions-to-the-latest-version-3-0-0-5 – user3711357 Jul 06 '14 at 16:35
  • Another thing, it is working while contracts and implementaiton service are in same project. But, When contracts are in separate assembly and implementation into separate assembly then it just fall and throwing exception, make sure you have added bidning/binding not found. Please guide... – user3711357 Jul 07 '14 at 06:15
  • You may want to make a new question out of it. – nvoigt Jul 07 '14 at 09:11
  • its resolved. there were need to create module binding for the class which is added in serviceBinding class into wcf service. (I mean, class which is binded in service binding of WCF service, that class further need to bind as there were also DI. You can add your previous comment as answer. Thanks. – user3711357 Jul 07 '14 at 17:35

0 Answers0