Questions tagged [ninject.web.mvc]

extension for ninject providing integration with ASP.NET MVC

Use this tag on questions that describe issues with this specific extension of the framework.

Main features that your question is about:

  • The integration between the Ninject core and ASP.NET MVC
  • Your extended HttpApplication (in Global.asax.cs) with NinjectHttpApplication
  • The activation of your controllers
  • Exposed dependencies and injections of types in
    • constructors
    • properties
    • methods

Github ninject.web.mvc extension

298 questions
0
votes
1 answer

Where is Ninject.Module.AssemblyNameRetriever.cs

I am trying to write an application where I am using Ninject DI container for dependency injection. While building I keep getting this exception saying cannot find AssemblyNameRetriever.cs. How can I get this file into my application when it doesn't…
user3527975
  • 1,683
  • 8
  • 25
  • 43
0
votes
1 answer

How to setup ninject when injection and Module binding (nInjectModule) into separate assembly

Following is project structure: MVC 4 application 1) Project is for MVC having controller has injected interfaces. 2) interfaces are existed into this application. Manager library project. 1) Project contain refernece of MVC…
0
votes
0 answers

How to do DI using nInject if two projects into presentation layer

One of application has below design: Presentation layer: 1) MVC 4 (contains reference to WCF service) and using ninject DI for controller constructor inject - where interface and implementation are both on same project - MVC. BAL and DAL 2) WCF…
0
votes
1 answer

Injecting HttpContext.Current in MVC Role Provider

I have a class in my MVC5 application that deals with some user related functionality and has a dependency on HttpContext.Current.User as shown below public interface IUser { // return roles of currently logged in user string[]…
user1625066
0
votes
2 answers

Attempt to resolve item from Ninject in IInterceptor fails

I am attempting to use Ninject on my current project, and up to now, have been loving it. I am in the middle of attempting to configure an IInterceptor object to intercept and handle a failed method call to my service layer. This is hosted in an…
0
votes
0 answers

How to define all dependencies in one project?

I have 6 projects. Asp.NET MVC 5 project, which depense from Service project (e.g., Asp.NET project needed IAccountService, which is implemented in Service project). DependencyInjection project, which have to manage dependencies in whole solution.…
0
votes
1 answer

How can I use same Ninject bindings in MVC and in my Models

I need to find a way to use Ninject in my classes (models) and also in my controllers of my MVC application. How can I do to use the same bindings in both sides? Right now I use my generated NinjectWebCommon.cs create my kernel and initialize the…
tzortzik
  • 4,993
  • 9
  • 57
  • 88
0
votes
1 answer

ninject ioc with inherited base generic repository

I have a generic repository, abstract and concrete as below public interface IGenericRepository where T : class public class GenericRepository : IGenericRepository where T : class I then have an repository that inherits from this, again…
Simon
  • 1,966
  • 5
  • 21
  • 35
0
votes
1 answer

Ninject bind any object of type T in request scope

I have an abstract class RequestScopeContainer which acts as a temporary data holder for the current request. public abstract class RequestScopeContainer { } Is possible to tell Ninject to bind any classes that implements the abstract…
Catalin
  • 11,503
  • 19
  • 74
  • 147
0
votes
1 answer

Ninject invalid cast exception

public partial class CTMSEntitiesModel : OpenAccessContext, ICTMSEntitiesModelUnitOfWork { public CTMSEntitiesModel(string connection) :base(connection, backend, metadataSource) { } // there are more IQueryable requests here } public…
safriss
  • 93
  • 2
  • 7
0
votes
1 answer

Store user data in Ninject-binding

I'm using Ninject in a ASP MVC-website. I'm looking for a way to store user-data (e.g. username, current group, etc) that is used on multiple places in my website, to prevent multiple database-calls accessing the same data in one request. My idea…
Pbirkoff
  • 4,642
  • 2
  • 20
  • 18
0
votes
2 answers

ASP.NET MVC and Ninject - result action with interface parameter

kinda new to MVC, and kinda new with Ninject. Playing around... I've defined ninject in my MVC application as follows: private static void RegisterServices(IKernel kernel) { kernel.Bind( x => x.FromThisAssembly() .SelectAllClasses() …
developer82
  • 13,237
  • 21
  • 88
  • 153
0
votes
1 answer

Ninject how often is a request scoped object created

I Have the following ninject configuration private static IKernel CreateKernel() { var kernel = new StandardKernel(); kernel.Bind>().ToMethod(ctx => () => new Bootstrapper().Kernel); …
Paul Plato
  • 1,471
  • 6
  • 28
  • 36
0
votes
2 answers

Implement FluentSecurity 2.0.0 with Ninject MVC

Error activating ISecurityContext using binding from ISecurityContext to SecurityContext. I'm getting the above error with FluentSecurity 2.0.0 when I'm trying to configure it with Ninject.Web.Mvc3 in an ASP.NET MVC 4 web application. I think the…
Boggin
  • 3,251
  • 3
  • 33
  • 48
0
votes
1 answer

how can we call ninjects service locator in code?

first time on stackoverflow + ninject (IoC's) I have a situation in which I have Business Objects Implemented in a way that they have Models in them... i.e. Public Class Whatever Implements IWhatEver Public Property Id as Integer Public…