ninject Questions

2

Solved

I want to create a simple Ninject provider that returns Moq'd instances instead of concrete types. So far I have this: public class NinjectMockProvider<T> : IProvider { public static Type T...
Eyewash asked 29/7, 2011 at 18:25

2

What would be the recommended way to use Ninject to inject the same HttpClient object to all Controller instances in an application? Currently, I am injecting an EntityFramework Database context f...
Sande asked 1/1, 2017 at 1:53

6

Solved

i have setup my project with Ninject IoC. My project has regular Asp.Net MVC controllers and Web Api controllers. Now, Ninject works with Web Api but Ninject doesn't work with regular Asp.MVC cont...

1

Solved

I have an issue with my COM add-in that has been dragging for months, and I can't figure out why. The IDTExtensibility2 implementation has been peer reviewed by Carlos Quintero (the guy behind MZ-...
Jornada asked 30/11, 2016 at 19:47

2

Solved

I have created and MVC 4 web application and decided to use web api in this app. I'm using ninject dependency resolver for MVC web app. and now I want to use this ninject dependency resolver for we...
Shiftless asked 16/1, 2014 at 9:46

3

Solved

I'm not quite sure when I should use SingletonScope() vs TransientScope() vs RequestScope() when I do my binding in my global.cs file. I have for example my call to MongoSession (using NoRM and th...
Biffin asked 27/7, 2010 at 21:21

1

Not quite the same as this: How do I Inject Dependencies with Ninject, where instances are deserialised from json Where the answer is that your data class that you deserialized shouldn't need a s...
Kaenel asked 10/8, 2015 at 19:36

2

Solved

I was looking at this tutorial http://asp-umb.neudesic.com/mvc/tutorials/validating-with-a-service-layer--cs on how to wrap my validation data around a wrapper. I would like to use dependency inje...
Kehoe asked 23/1, 2011 at 20:48

4

Solved

I am new to dependency injection, but happy with Ninject and Ninject.Extensions.Logging to [Inject] my ILogger wherever i need it. However some DelegatingHandlers are spoiling all the fun. public...

3

Solved

My question is a bit related to this: WebApi equivalent for HttpContext.Items with Dependency Injection. We want to inject a class using HttpContext.Current in WebApi area using Ninject. My concern...
Lorineloriner asked 25/7, 2014 at 12:47

3

Solved

I am attempting to create a "barebones" Web API project that uses OWIN middleware, Ninject Depencency Injection, and ultimately to be hosted in IIS. I have followed instructions found in an article...
Bluefield asked 25/2, 2015 at 5:39

3

Solved

I am still a bit new to using IOC containers and I'm struggling a bit. I am using ASP.NET MVC 5.2 with Ninject.MVC3. I have an exception filter that basically hands off to a log service: public cl...
Inland asked 1/10, 2016 at 22:22

2

Solved

Please forgive my ignorance, but I am very new to IOC and NinJect. I have searched for high and low for easily understandable solutions but so far they have eluded me. So far I have the following ...
Jehu asked 21/7, 2011 at 12:16

1

Solved

Example solution to demonstrate the problem: class World { public override string ToString() { return "Hello World"; } } class Hello { [Inject] public World theWorld { get; set; } public He...
Susuable asked 19/9, 2016 at 19:46

15

Solved

I've created an empty Asp.Net MVC3 project, and used nuget install-package Ninject.MVC3 Without doing anything else (no services registered and not even a controller created) I run the application...
Delete asked 6/5, 2011 at 10:57

2

I'm having a problem getting the wcf extensions to work with more than one self host bootstrapper. With one my services are created by ninject fine (per call), but when I add another I get an excep...
Mandymandych asked 2/7, 2013 at 12:55

1

In my Ninject binding module, public class CarModule : NinjectModule { public override void Load() { Kernel.Bind(scanner => scanner.FromThisAssembly().SelectAllClasses() .InheritedFrom&l...
Madid asked 9/4, 2013 at 2:38

2

Solved

I am using NHibernate in an MVC C# application with MySQL. I am trying to have multiple users access the session. I have been using .InRequestScope() on my session but i am still getting: System...
Apteryx asked 26/7, 2016 at 18:6

3

I'm using MVC 4 and Ninject 3 with NinjectWebCommon in the App_Start folder. And my Global.asax.cs is MvcApplication : HttpApplication I'm getting the error below because the Ninject is starting ...
Redfield asked 24/9, 2013 at 22:12

2

Solved

My understanding of WithConstructorArgument is probably erroneous, because the following is not working: I have a service, lets call it MyService, whose constructor is taking multiple objects, and...
Daimyo asked 20/11, 2012 at 3:57

4

Solved

In MVC I simply make the class NinjectControllerFactory that implements DefaultControllerFactory interface then do some bindings in it. at last in Global I run it: ControllerBuilder.Current.SetCon...

3

I am migrating from IIS WebAPI to OwinHost. Utilizing the latest pre-release versions of nuget packages, I successfully used instructions here: https://github.com/ninject/Ninject.Web.Common/wiki/S...
Thorium asked 27/5, 2014 at 18:47

2

Solved

I've been trying for ages to figure this our. when i try to bind my class with an interceptor i'm getting the following exception on the line Kernel.Bind<MyClass>().ToSelf().Intercept().Wit...
Discovert asked 3/4, 2012 at 6:31

2

Solved

I'm trying to use UserManager in a class, but I'm getting this error: Error activating IUserStore{ApplicationUser} No matching bindings are available, and the type is not self-bindable. I'm usin...
Lime asked 17/3, 2015 at 1:30

3

Solved

I am attempting to set up DI on ActionFilters in ASP.NET WebAPI using Ninject. I followed the instructions here: https://github.com/ninject/Ninject.Web.WebApi/wiki/Dependency-injection-for-filters ...
Corrugation asked 15/5, 2016 at 16:11

© 2022 - 2024 — McMap. All rights reserved.