You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my webservice global inherits from NinjectHttpApplication, then the application fails with the following error:
Error activating IntPtr
No matching bindings are available, and the type is not self-bindable.
Activation path:
3) Injection of dependency IntPtr into parameter method of constructor of type Func{IKernel}
2) Injection of dependency Func{IKernel} into parameter lazyKernel of constructor of type HttpApplicationInitializationHttpModule
Request for IHttpModule
The following code resolved this error:
public class Global : NinjectHttpApplication
{
protected override void OnApplicationStarted()
{
base.OnApplicationStarted();
}
protected override IKernel CreateKernel()
{
//define modules loaded by default
var modules = new INinjectModule[]
{
new ServiceModule(),
new EntityContextModule(),
};
IKernel kernel = new StandardKernel(modules);
//hack for Ninject.Web.Common.HttpApplicationInitializationHttpModule
kernel.Bind<Func<IKernel>>().ToMethod(c => () => GetKernelInstance());
return kernel;
}
private IKernel GetKernelInstance()
{
//this method is deprecated
return this.Kernel;
}
}
Is this intended?
The text was updated successfully, but these errors were encountered:
If my webservice global inherits from NinjectHttpApplication, then the application fails with the following error:
Error activating IntPtr
No matching bindings are available, and the type is not self-bindable.
Activation path:
3) Injection of dependency IntPtr into parameter method of constructor of type Func{IKernel}
2) Injection of dependency Func{IKernel} into parameter lazyKernel of constructor of type HttpApplicationInitializationHttpModule
The following code resolved this error:
Is this intended?
The text was updated successfully, but these errors were encountered: