4

I want to add nInject into WCF service and i followed below steps. http://www.aaronstannard.com/post/2011/08/16/dependency-injection-ninject-wcf-service.aspx

Problem: I am not able to find NinjectWcfApplication class to inherit for global.asax.

Kindly let me know which module i have to add so, i could find NinjectWcfApplication class and able to inject into wcf service class.

Added - ninject.extensions.wcf nuget package. <package id="Ninject" version="3.2.2.0" targetFramework="net40" /> <package id="Ninject.Extensions.Wcf" version="3.2.1.0" targetFramework="net40" />

Please guide me how to resolve this.

Thank You

user3711357
  • 1,425
  • 7
  • 32
  • 54

1 Answers1

0

I believe that not have more this class. After adding the Ninject.Extensions.Wcf extent and factory in the service, add the nuget dependencies:

  1. Microsoft.Web.Infrastructure
  2. WebActivatorEx.

Once this is done, create a NinjectWebCommon class, similar to the MVC. For me it worked that way.

Good luck.

jmsandy
  • 141
  • 5