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
3
votes
1 answer

Bind all concrete implementations by name in Ninject

I have an interface IAdapdor, and several concrete implementations. Using Ninject 3.0, I bind them all by name: IKernel kernel = new…
bavaza
  • 10,319
  • 10
  • 64
  • 103
3
votes
1 answer

Cannot get Ninject.Extensions.Conventions to work

I've been trying to get Ninject.Extensions.Conventions for (Ninject 3+) working, with no luck. I boiled it down to a found sample console app, and I can't even get that going. Here's what I have: class Program { static void…
Michael Cook
  • 1,676
  • 2
  • 26
  • 47
3
votes
3 answers

Ninject and Log4Net

I can't seem to get ninject to automatically create an instance of ILogger. I have log4net set up in my tests application and configured properly but for some reason when I instantiate the IHouseholdRepository it can't work out the ILogger.…
Josh
  • 79
  • 1
  • 8
3
votes
1 answer

Why Ninject does not release disposed objects with InCallScope?

I'm trying to use Ninject (version 3.0.1) in a WinForms application, I have several (currently) self-binded service class, which I construct using Ninject. Some service class needs other service classes (sub-services). Most of these service classes…
Zoltán Tamási
  • 12,249
  • 8
  • 65
  • 93
3
votes
1 answer

Ninject factory extension and InCallScope does not give expected results

I am struggling with using the factory extensions for Ninject. When using the extension in combination with InCallScope, I expected the same instance to be returned from the factory's create method, but instead I get two different instances. Have I…
ForestC
  • 213
  • 1
  • 12
3
votes
1 answer

Ninject Binding by Convention not working with generics types

I am using .NET 4.5, Ninject 3 with the binding by convention lib as follow: kernel.Bind(x => x .FromAssembliesMatching("assembly.dll") .SelectAllClasses().InheritedFrom(typeof(ICommandHandler<>)) .BindAllInterfaces()); And this is…
Adam
  • 3,872
  • 6
  • 36
  • 66
3
votes
1 answer

Null Reference Exception using Ninject with Ninject.Extensions.Nlog2

I have a simple console app using Ninject, Ninject.Logging and Ninject.Extensions.NLog2 all build with latest nuget packages. My App does the following _kernel = new StandardKernel(); ILogger logger = _kernel.Get(); And I get a Null…
Twisted
  • 2,939
  • 4
  • 32
  • 54
3
votes
1 answer

Lifetime management with Ninject Dependency Creator and Event Broker

I'm using Ninject in a reasonably large project and want to utilize the Dependency Creation and Event Broker extensions. The Dependency Creation readme gives the following example (although I believe InCreatorScope has possibly been renamed to…
Matt B
  • 8,315
  • 2
  • 44
  • 65
3
votes
1 answer

Ninject.Extensions.Logging.Log4Net Produces Incorrect Output for Class/Method Name

I'm using Ninject 3.0.1.10 for dependency injection and want to use Ninject.Extensions.Logging 3.0.1.0 for log4net 1.2.11 logging. However, I'm getting different output in my log files when using the extension rather than log4net directly. I want…
Adam Rodger
  • 3,472
  • 4
  • 33
  • 45
3
votes
0 answers

Configure Ninject for WF services to be hosted in IIS

I have a asp.net application. I am using Ninject to resolve dependencies. I am using WF Services which will be hosted on IIS. These services will be consumed by my asp.net application. For WF I have a class library for custom activities, which is…
Saurabh
  • 31
  • 2
3
votes
1 answer

Ninject.MVC3 invalid path to NinjectWebCommon.cs

I'm using the Ninject.MVC3 in my application and it has been working great until I desided to rename my solution/projects. Everything has been renamed correctly and all tests passes and so on. The one thing that does not work is the generated…
Pelle
  • 2,755
  • 7
  • 42
  • 49
2
votes
1 answer

Ninject Factory Custom Instance Provider

I'm using the Ninject Factory Extension and creating a custom instance provider explained in the wiki: class UseFirstArgumentAsNameInstanceProvider : StandardInstanceProvider { protected override string GetName(System.Reflection.MethodInfo…
Dismissile
  • 32,564
  • 38
  • 174
  • 263
2
votes
1 answer

Ninject ActivationException on ChildKernel

I'm getting an ActivationException saying there was an error activating IEventBroker. MyDataSource takes an IEventBroker has a parameter. If I don't use the child kernel, there is no issue. What is going on? var kernel = new…
Robert
  • 6,086
  • 19
  • 59
  • 84
2
votes
1 answer

Ninject Factory on Derived Types

I'm looking at the Ninject Factory extension at the following link: http://www.planetgeek.ch/2011/12/31/ninject-extensions-factory-introduction/ I'm trying to wrap my head around the extension and see if it actually fits into what I'm trying to…
Dismissile
  • 32,564
  • 38
  • 174
  • 263
2
votes
2 answers

How to Inject properly an IDBContextFactory into a controller's inject IDomainFactory using Ninject MVC3?

Preliminaries I'm using Ninject.MVC3 2.2.2.0 Nuget Package for injecting into my controller an implementation of a IDomain Interface that separates my Business Logic (BL) using an Factory approach. I'm registering my Ninject Modules in the…