In my NinjectWebCommon.cs
file, under CreateKernel
method I am applying the injection like this
private static IKernel CreateKernel()
{
var kernel = new StandardKernel();
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
RegisterServices(kernel);
// Web API Injection
GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(kernel);
// SignalR Injection
GlobalHost.DependencyResolver = new SignalR.Ninject.NinjectDependencyResolver(kernel);
return kernel;
}
I was thinking that should do it for me but i keep getting an error at the SignalR injection that
"Cannot implicitly convert type 'SignalR.Ninject.NinjectDependencyResolver' to 'Microsoft.AspNet.SignalR.IDependencyResolver'"
Any idea what the problem is?
(Microsoft.AspNet.SignalR.IDependencyResolver)
when you perform the assignment. – DetectiveNinjectDependencyResolver
inherits fromMicrosoft.AspNet.SignalR.IDependencyResolver
? Can you paste the code? – Acidulant