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

Ninject and OnePerRequestModule

I have recently tried out Ninject with the Ninject.Web.Mvc extension, and I've noticed something peculiar and, while not breaking, confusing. In the NinjectHttpApplication abstract class, there is a constructor defined as follows.. ///…
Ciel
  • 17,312
  • 21
  • 104
  • 199
11
votes
5 answers

Ninject-ing a dependency in Global.asax

I'm starting a web application with MVC3 and Ninject. There is one dependency that I also need in the Global.asax file that needs to be a singleton. I thought it should be like this: public class MvcApplication : NinjectHttpApplication { …
vtortola
  • 34,709
  • 29
  • 161
  • 263
11
votes
1 answer

Setup Ninject for WCF

Does anyone have a clear instruction on how to setup Ninject in WCF? been googling around but I cant see any updated guidelines on how to use Ninject in WCF.
Romeo
  • 1,791
  • 8
  • 25
  • 41
10
votes
2 answers

Ninject 3 InRequestScope not returning the same instance for the same request

Recently, I upgraded one of my MVC3 projects from Ninject 2 to Ninject 3. After a couple of minutes trying to find why InRequestScope was not anymore available, I found that this is now an extension of Ninject.Web.Common. Now, when I try to run the…
Samuel
  • 12,073
  • 5
  • 49
  • 71
9
votes
1 answer

Convention Based Dependency Injection with Ninject 3.0.0

I have two projects in my solution... a domain project and MVC3 web project (e.g. MyApp.Domain and MyApp.Web). Previously, when using Ninject.Extensions.Conventions ver. 2, I was able to use the following statement in the NinjectMVC3.cs file, and…
bigmac
  • 2,553
  • 6
  • 38
  • 61
9
votes
3 answers

Ninject ActivationException: Error activating IAlertManagement

I'm getting the following error: Test method: BootStrapperTest.Can_Create_Alert_Management_Object threw exception: Ninject.ActivationException: Error activating IAlertManagement No matching bindings are available, and the type is not…
Cole W
  • 15,123
  • 6
  • 51
  • 85
9
votes
1 answer

Upgrading Ninject/Ninject WCF Extensions to the latest version 3.0.0.5

I am currently using Ninject (2.2.1.4) and Ninject.Extensions.Wcf (2.2.0.4) with my WCF service. I would like to upgrade to Ninject (3.0.0.15) and Ninject.Extensions.Wcf (3.0.0.5) and it doesn't look like I can use my current approach anymore. Can…
Thomas
  • 5,888
  • 7
  • 44
  • 83
8
votes
1 answer

What is the proper way of using Ninject convention based binding?

I use Ninject mainly as manual binding like bellow. Which is working properly kernel.Bind().ToSelf().InRequestScope(); kernel.Bind().To(); But when I try bind using Convention based binding, bit…
7
votes
2 answers

Ninject WCF Extension ArgumentNullException using NET.TCP Binding

I have a WCF 4 service with 2 endpoints configured to use wsHttpBinding and netTcpBinding. I am hosting the service within IIS 7.5 using WAS and am using the Ninject WCF extension to DI into my service. My service works fine when I use the…
Cragly
  • 3,554
  • 9
  • 45
  • 59
7
votes
1 answer

NamedScope and garbage collection

(This question was first asked in the Ninject Google Group, but I see now that Stackoverflow seems to be more active.) I'm using the NamedScopeExtension to inject the same ViewModel into both the View and the Presenter. After the View have been…
7
votes
2 answers

Ninject + Web ApI 2: Error activating IFilterProvider using binding from IFilterProvider to DefaultFilterProvider

I originally had used some custom code I found to handle the dependency resolution in Web API and it worked fine. The issue I ran into was that I wanted to bind a filter to my controller scopes just like you can with MVC. For example,…
oliwa
  • 1,834
  • 1
  • 16
  • 19
7
votes
1 answer

Ninject Method-level interception with params

I've noticed in the tutorials for interception that you can target a method and intercept it. I.e. Kernel.Bind().ToSelf(); Kernel.InterceptReplace(foo => foo.ThrowsAnError(), invocation => {} ); The documentation/tutorial does not cover…
6
votes
2 answers

Ninject.Extensions.Logging.Log4net unexpected behavior

I am having a problem using Log4Net (1.2.10) through Ninject's (2.2.1.4) Extensions.Logging.Log4net (2.2.0.4), as installed through NuGet. When I access Log4Net directly: var logger =…
6
votes
2 answers

Ninject - Request scope has already been disposed

I'm using Ninject and the extensions EventBroker and DependencyCreation in an MVC 3 application. I've installed and am using the Ninject.MVC3 package and therefore the OnePerRequestModule. I'm attempting to inject a service, called IParentService…
Matt B
  • 8,315
  • 2
  • 44
  • 65
6
votes
1 answer

What is the difference between "scope", "context", etc. in Ninject?

Can the Ninject concepts of scope, context, named binding, (and activation block?) be separated and explained clearly at a conceptual level? As an example, I have a service that loads data records from a database and for each record it constructs a…
kaliatech
  • 17,579
  • 5
  • 72
  • 84
1
2 3
13 14