在我NinjectWebCommon.cs
文件,下CreateKernel
方法,我应用注入这样
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;
}
我想,应该为我做的,但我一直在SignalR注入得到一个错误
“无法隐式转换类型‘SignalR.Ninject.NinjectDependencyResolver’到‘Microsoft.AspNet.SignalR.IDependencyResolver’”
任何想法是什么问题?