Questions tagged [ninject-extensions]

Ninject Extensions are a collection of open-source projects designed to extend the functionality of the Ninject open-source dependency injector for the .NET framework.

Ninject Extensions are a collection of open-source projects designed to extend the functionality of the Ninject open-source dependency injector for the .NET framework.

Extension projects include, among others, those targeted at situations involving specific technologies such as MVC and WCF, as well as situations involving design patterns, such as Factories and Conventions.

207 questions
4
votes
0 answers

Read request message body while binding dependency using ninject.extensions.wcf

I am using Ninject.Extensions.Wcf in a WCF service, and also have the Ninject.Web.Common package in my project. In the NinjectWebCommon class this is how I bind my dependency kernel.Bind().To(); straightforward…
labroo
  • 2,901
  • 3
  • 27
  • 36
4
votes
0 answers

Can I make the ninject mocking kernel and factory extensions work together?

I use ninject extensively with the factory extension. I also use moq to help with testing and in some cases (particularly complicated view models in my MVVM WPF application) I use the ninject mocking kernel to make it easier to automatically create…
simmdan
  • 616
  • 6
  • 9
4
votes
1 answer

Can't get Ninject Interception to work with WCF

we're switching from UNITY to Ninject as our default service locator for WCF services. There's a beautiful NuGet package available for doing this and getting the standard resolution up-and-running is a breeze. However - I want to intercept the calls…
Jochen van Wylick
  • 5,303
  • 4
  • 42
  • 64
4
votes
1 answer

NinjectServiceHost in WCF service does not call Dispose()

I've been trying to get the Dispose method on my IDisposable WCF service called whilst using Ninject's NinjectServiceHost without any luck. I've then downloaded the Ninject.extensions.WCF example code and tried to get the IDisposable TimeService's…
mips
  • 2,137
  • 2
  • 19
  • 21
4
votes
0 answers

Partial mocking with MockingKernel for an abstract class?

I have an abstract class with a dependency which I would like to unit test: public abstract class BaseClass { public BaseClass(IDependency dep) { ... } public virtual void TestMethod() { ... } ... } I want to test this class using…
ladenedge
  • 13,197
  • 11
  • 60
  • 117
4
votes
3 answers

WCF / Ninject / Default (parameter-less) constructor

I'm trying to add Ninject to a WCF service using the WCF Ninject extension. I'm getting the error: The service type provided could not be loaded as a service because it does not have a default (parameter-less) constructor. To fix the problem, add a…
もしもし
  • 193
  • 3
  • 11
4
votes
2 answers

How do I bind generic types with inheritance using Ninject Conventions extensions

How can I bind InitializerForXXX (non-generic implementation) to IInitializer (generic interface) using Ninject Conventions so that requests for an IInitializer resolve a non-generic implementation whose name starts with InitializerFor and…
4
votes
1 answer

Ninject Interception: Service calling intercepted method not being intercepted when called within itself

I have a service class injected with Ninject 3.0. I have set it up so it's proxy is a class proxy rather than an interface proxy. The service has 2 methods, a first one returning broad result and a second one calling the first one and filtering…
fireOut
  • 39
  • 1
  • 2
4
votes
1 answer

Using Ninject.MockingKernel with Asp.Net Web API

I've set up a Web API project using Ninject, and I've used the fix detailed here for getting it to work with the latest version of the Web API. Everything is working fine, but I'm now trying to write some tests. I'm using in-memory hosting to run…
Paul Manzotti
  • 5,107
  • 21
  • 27
4
votes
1 answer

Ninject bind all factory interfaces

Is there a simple way to use Ninject to bind all Factory interfaces to the ToFactory() extention method? public class Foo { readonly IBarFactory barFactory; public Foo(IBarFactory barFactory) { this.barFactory = barFactory; …
Telavian
  • 3,752
  • 6
  • 36
  • 60
3
votes
1 answer

Use Ninject.Wcf in ASP.NET MVC3. Deriving from NinjectWcfApplication disables application

I am using AJAX-enable web services in my ASP.NET MVC3 application and I want to inject some classes in to them. So I installed NInject.Wcf, set factory to Ninject.Extensions.Wcf.NinjectServiceHostFactory and next step is derive application…
Alexander
  • 1,287
  • 1
  • 15
  • 34
3
votes
2 answers

Ninject Di bindings using a WCF service

I recently created a WCF service library. I am planning on hosting it in IIS. Since I want to reuse my repository layer I decided to go use Ninject in my WCF service as well (I use it in other projects in the solution). I installed the Ninject Wcf…
Thomas
  • 5,888
  • 7
  • 44
  • 83
3
votes
1 answer

How to use Ninject's NamedLikeFactoryMethod with parameters correctly?

I have a C# Console application in which i use Ninject. If I run it with the following code, the console says: "A Dog with the name Dogy was created, he is 7 years old". This result is actualy fine to me since i passed 7 as a parameter in the…
AkurA87
  • 45
  • 4
3
votes
1 answer

Ninject Factory + InCallScope + ContextPreservation

First of all, I'm aware of the related post here, but that post is quite old, and what's more important, not answered straightly. So now I use the latest Ninject (stable, 3.2 Nuget packages) and the above mentioned extensions, and still see a…
Zoltán Tamási
  • 12,249
  • 8
  • 65
  • 93
3
votes
1 answer

Exception after Binding Ninject Factory Extension in non generic way

I have following code: public interface ILogging { ... } public interface ILoggingFactory { ILogging CreateLogging(); } public class MailSender : IMailSender { [Inject] public MailSender(ILoggingFactory loggingFactory) { ... …
StefanG
  • 1,234
  • 2
  • 22
  • 46
1 2
3
13 14