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
2 answers

Ninject.Mvc5 does not work with mono

Am following video tutorial from you-tube for making web app with ASP.Net. The guy teaching there is using Windows and Visual Studio. I'm on Ubuntu 14.04 and Monodevelop. Everything is set and running but Ninject (3.2.0.0) does not work. After…
Stefano Mtangoo
  • 6,017
  • 6
  • 47
  • 93
0
votes
1 answer

Ninject MVC3 leads to "cannot find file Mvc.sitemap"

I am trying to use Ninject on a Web project. In Visual Studio I ran Install-Package Ninject.MVC3 But now when I run the project I get the error Could not find file '\Mvc.sitemap' What is this Mvc.sitemap file?
Mike Kantor
  • 1,400
  • 4
  • 24
  • 45
0
votes
2 answers

Ninject InRequest Scope Losing Binding

I'm having a frustrating issue with Ninject and MVC 4. Here is the code block: Kernel.Bind().To(); Most of the time, this is fine, and I have a user info. Sometimes,…
0
votes
2 answers

inject - InSessionScope Extension problems with AppFabric Cache

Ninject doesn’t provide a InSessionScope Binding for Websites, so we have created our own extension: public static IBindingNamedWithOrOnSyntax InSessionScope(this IBindingInSyntax parent) { return…
squadwuschel
  • 3,328
  • 3
  • 34
  • 45
0
votes
1 answer

How to load the correct controller based on host name

I am looking for some advice on how to achieve the following. I have an MVC5 .NET web application. In this application I have created a base controller, this controller is the parent for many child controllers. Each child controller has its own set…
Mike Ross
  • 155
  • 1
  • 1
  • 9
0
votes
2 answers

Ninject IoC Project website

I know this question has no related code to be written, but I am planning on using Ninject IoC and I was trying to visit www.ninject.org, however the webpage is not available. Has this project been discontinued? I just want to know if i should look…
0
votes
0 answers

Convert Automapper application to new Ninject project

Our team has inherited a MVC project that uses Automapper. We will be building on top of this project for enhancements. Overall, it's coded very well and will be a good framework for us. The issue is we like to use Ninject for all our projects. …
0
votes
1 answer

Switching from Mock IProductRepository Implementation to Entity Framework displays nothing

I am working through the Book "Pro ASP.NET MVC 5 - Adam Freeman ' . In chapter 7 the Sportstore application is built and the Products are first displayed with the Mock Repository on page 174. Everything works fine up to here. Adding the Mock…
Arnie
  • 83
  • 2
  • 8
0
votes
2 answers

Simplify NinjectWebCommon RegisterServices with a Generic Service

I'm using Ninject.MVC3 for my DI. I have more than 25 dependencies to inject, but my RegisterService now has 25 lines with simlar code like: private static void RegisterServices(IKernel kernel) { …
Benjamin RD
  • 11,516
  • 14
  • 87
  • 157
0
votes
0 answers

Ninject Interception not working with MVC 5

I am trying to implement an InterceptAttribute which should intercept any method I add the attribute to. I have it working in a WebAPI solution, however, I cannot get it to work in an MVC 5 application. The code is the same in both projects. The…
0
votes
2 answers

AddBindings in Ninject and null repository in Controller class

In my NinjectDependencyresolver I have this: public NinjectDependencyResolver(IKernel kernelParam) { this.kernel = kernelParam; AddBindings(); } private void AddBindings() { …
0
votes
0 answers

Using ninject manually in MVC5 for View access

I have the MVC5 ninject NuGet module installed on my web application, and I am injecting dependencies into controllers like a pro. It was incredibly easy to set up and use. One of my injected abstractions is the IApplicationSettingsProvider: public…
0
votes
1 answer

Can I use Ninject Modules in any way in constraining the resolution of a request

In our web project we are using Ninject. Now we are adding plugins to our application. We want plugins to be able to add their own bindings. Ninject modules seems like a logical solution to this problem. However, I don't see any guidance on how to…
Michael Welch
  • 1,754
  • 2
  • 19
  • 32
0
votes
1 answer

Pass User.Identity.Name as argument to Service Constructor with Ninject

im injecting with ninject a concrete type in the controller constructor like so. public class HomeController : BaseController { IUserService userService; public HomeController(IUserService _userService) { …
Aflred
  • 4,435
  • 6
  • 30
  • 43
0
votes
1 answer

Typecast error while binding in ninject framework

I'm new to Dependency Injection and also the book using recommends ninjectKernel as DI framework, book is referenced here . I am getting an error in following method: protected override IController GetControllerInstance(RequestContext…
amit kohan
  • 1,612
  • 2
  • 25
  • 47