I am using RequestScope of NInject in my application
Bind<ITestClass>().To<TestClass>().InRequestScope();
But when i called dispose method on this class, method calls and the code that has been written in method calls(i check it using breakpoint) but the object itself didn'y dipose, I guess Ninjec开发者_如何学JAVAt Request scope has something to do with it, as it is working perfectly fine, when I did not use RequestScope.
Kernel.Get<ITestClass>().Dispose();
While Ninject pre-2.4 has deterministic Disposal for ASP.NET applications, InRequestScope
does not do what you might hope it would do in the context of a WCF-Only request (as opposed to running WCF in 'spin up a HttpRequest for each WCF Operation' mode).
@Remo Gloor will no doubt be in touch to clarify further.
Can you indicate where you get / how you build / what your exact build number is for your Ninject stuff. Also, please provide some further details as to how you do your WCF integration - are you following a sample? Do you hook in the Ninject-provided ServiceHostFactory? If you can provide details like that, it lets people answering the question infer what sort of assumptions you might be making and take that into account in generating an answer. If I dont see any evidence of this next time, I wont comment or answer any of your questions. (And not responding to comments on other posts also doesnt encourage people to want to help you either.)
Please put some more effort in to provide salient details and enable people to answer your questions first time without having to chase your for the details. This has happened too many times. I'm all for keeping the question on the good side of TL;DR, but just do an executive summary and a detailed block.
精彩评论