I use Ninject version="3.2.2.0" and last version of EasyNetQ 0.63.5.454. I've created simple project.
static class Program
{
static void Main()
{
var kernel = new StandardKernel(new NinjectSettings(){LoadExtensions = true});
kernel.Load<MyModule>();
kernel.RegisterAsEasyNetQContainerFactory();
var b = kernel.Get<IBus>();
}
}
public class MyModule : NinjectModule
{
public override void Load()
{
Kernel.Bind<IBus>().ToMethod(t => RabbitHutch.CreateBus("host=localhost;publisherConfirms=true")).InSingletonScope();
}
}
But in line var b = kernel.Get<IBus>();
I get System.StackOverflowException.
In the debug mode I see recursive call of Kernel.Bind().ToMethod() though it has Singleton Scope.
Do you have any ideas why it's happens?
Thanks in advance.