ninject Questions
6
Solved
I have some code that is using ninject to inject dependencies, these dependencies are actual strings. Is this an anti-pattern to inject strings rather than creating a new object for example.
I.e. ...
Mikol asked 11/9, 2013 at 10:15
2
Solved
According to this tutorial, to use Ninject in my Asp.net MVC 3 application , all I have to do is install package via Nuget and configure dependencies.
Follow these steps
Install Package-Ninject...
Venesection asked 10/10, 2011 at 23:50
2
I've made a simple piece of OWIN middleware that will get me a User object and add it to HttpContext.Current.Items so that's available for all controllers and views for each request.
Here's my cod...
Necessity asked 21/5, 2014 at 7:43
3
Solved
According to the official site: The best place to learn about Ninject is from the official wiki on Github.
Is that true? As a beginner, I found the official wiki not very helpful. Are there any be...
Joellajoelle asked 8/3, 2011 at 22:18
1
Solved
I'm trying to add IHttpClientFactory to NInject in my C# ASP.NET Web Forms application so that I can use it in services. There is lots of documentation online about using IHttpClientFactory (and no...
Spectrophotometer asked 28/11, 2019 at 15:28
2
Solved
I have a class with a constructor having a parameter with a default value. With Ninject 2.2, it would honor the [Optional] attribute and work fine with no binding defined against a constructor decl...
4
Solved
so I am currently working on an ASP.NET MVC web application that uses Entity Framework, I'm also using Ninject for Dependency Injection.
So basically, at the moment, this is how I register my DbCo...
Conclude asked 19/3, 2015 at 19:53
10
Solved
Here is the trace:
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>
Type 'ProjectName.Web.Api.Controllers.ContinentsController' does not have a defa...
Herbarium asked 4/7, 2013 at 5:0
3
Solved
I am a learning Xamarin and I wanted to use Ninject for IoC containers and dependency injection. I added Ninject 3.3.4 using NuGet package on Visual studio 2017 community. I receive error on the fo...
3
Solved
When I have a class with no default constructor, i.e. using dependency injection to pass its dependencies, can Newtonsoft.Json create such an object?
For example:
public class SomeFoo
{
privat...
Catachresis asked 18/2, 2014 at 16:33
3
I've got a reasonably-sized ASP.NET MVC/WebApi web application (~100KLOCS) that is creaking a bit under the load (about 1MM requests / day). For instance, a page typically takes 2-3 seconds to load...
Subscapular asked 8/1, 2015 at 19:54
2
Solved
If I register:
Bind<IWeapon>().To<Sword>();
Bind<IWeapon>().To<Knife>();
Bind<IWeapon>().To<ChuckNorris>();
And then retrieve via:
IEnumerable<IWeapon>...
Converse asked 21/10, 2011 at 8:31
4
Solved
Consider the following code.
public interface IFoo { }
public class Bar
{
public Bar(IFoo[] foos) { }
}
public class MyModule : NinjectModule
{
public override void Load()
{
Bind<IFoo[]...
Trajan asked 23/6, 2010 at 15:12
2
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 jus...
Adjunction asked 3/6, 2014 at 15:33
5
Ninject kernel binding is like this as you know.
kernel.Bind<IMyService>().To<MyService>();
I want to get MyService from xml. WebConfig or App.Config like this.
<add key="service...
Damascene asked 30/9, 2013 at 11:13
3
Solved
I have a project where the Ninject is used as IoC container. My concern is that a lot of classes have such kind of constructors:
[Inject]
public HomeController(
UserManager userManager, RoleManag...
Athal asked 5/9, 2012 at 15:9
3
Solved
We use ninject in all our projects, and as you will know, sometimes it becomes hard to test if the kernel would be able to resolve every type at execution time, because sometimes control gets lost ...
Braque asked 11/9, 2012 at 13:38
2
Solved
I have the following httphandler:
public class NewHandler : IHttpHandler
{
[Inject]
public IFile FileReader
{
get;
set;
}
public NewHandler()
{
}
public void ProcessRequest(System.Web....
Polemics asked 2/9, 2010 at 17:12
3
Solved
I'm a newbie using Ninject and I can't figure out how to inject into my generic http handler. I have a MVC3 project and I'm injecting my services into controllers with no problem at all.
This is wh...
Crossruff asked 4/5, 2012 at 10:4
3
Solved
I am new to both EF and Ninject so forgive me if this does not make sense :)
I have an MVC3 application with the Ninject and Ninject.Web.Common references. I am trying to inject a DbContext into m...
Outgo asked 22/6, 2012 at 3:28
7
Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0' or one of its dependencies
I am adding Ninject in MVC project using the following commands in Package Manager Console:
Install-Package Ninject -version 3.0.1.10
Install-Package Ninject.Web.Common -version 3.0.0.7
Install-Pa...
Pardoner asked 4/6, 2014 at 3:37
1
Solved
I have a ASP.NET WebForms application that uses some Ninject packages, but I am stuck at a certain version. When I try to upgrade to the latest version, I get "Unable to resolve dependencies" issue...
Fugger asked 11/9, 2018 at 9:9
3
Solved
I am doing an Empty Web API in Visual Studio 2013 Framework 4.5. Obviously NinjectWebCommon.cs do not appear.
I installed via Nuget,
Ninject,
Ninject.Web.Common,
Ninject.MVC5,
Ninject.Web.Commo...
Orenorenburg asked 29/10, 2017 at 14:8
17
Solved
UPDATE - Please look at my answer for a link and explanation of the solution to this problem
Before we start, I know this is a very common question and I've been using Ninject for many moons witho...
Upkeep asked 7/9, 2012 at 3:51
3
Solved
I have an Interface that is implemented by several types. But before I do a kernel.GetAll<IAmServiceable>() I want to be able to ponder the target types of the injection.
I know the function...
Kellby asked 20/4, 2012 at 8:51
© 2022 - 2024 — McMap. All rights reserved.