Linked Questions
11 questions linked to/from MVC5, Web API 2 and Ninject
62
votes
3
answers
40k
views
404 error after adding Web API to an existing MVC Web Application
There's a great question here: How to add Web API to an existing ASP.NET MVC 4 Web Application project?
Unfortunately, it wasn't enough to solve my problem. I've tried twice to be sure I haven't done ...
4
votes
1
answer
4k
views
MVC5, WebAPI2 and Ninject Parameterless constructor error
So I have the exact opposite problem as MVC5, Web API 2 and Ninject
I have a new MVC5/WebAPI2 project, that has both "Controller"s and "ApiControllers".
I'm using the latest unstable version of ...
3
votes
1
answer
1k
views
When should one use Kernel.BeginBlock() in Ninject.MVC3
I'm using Ninject.MVC3 with WebAPI.
Originally, I was using the implementation of NinjectResolver and NinjectScope as outlined here,i.e. using _kernel.BeginBlock(),
I noticed that BeginBlock() gets ...
1
vote
1
answer
4k
views
How do I use Ninject with ASP.NET MVC5
I am trying to set up a brand new project using MVC 5 and the latest Ninject.MVC5 nuget package. However I am getting a "No parameterless constructor defined for this object" exception.
I have ...
1
vote
1
answer
2k
views
MVC API controller error with dependency injection
i have a simple controller where i am using the interfaec like this ,
public class HomeController : Controller
{
// GET: Home
private IHotelService hotelService;
public HomeController(...
0
votes
1
answer
1k
views
Where instance should be created in web api controller
In web api controller, I used to create instance within using keyword so Once it come out from the using, GC will be called and memory will be released.
The code which I'm using right now,
public ...
0
votes
1
answer
2k
views
Ninject doesn't resolve dependency (parameterless constructor error)
I'm struggling with enabling Ninject's constructor injection in a Web Service application. Here's the steps I took (Visual Studio 2013):
1) Created a new project with "ASP.NET Web Application" ...
0
votes
1
answer
1k
views
Ninject for Web Api 2 is not working in ASP.NET MVC
I am developing an ASP.NET MVC application. In my application, I need to provide REST API. So I added Web Api 2 to my existing MVC application. Before I added Web API 2, I was using ninject for ...
2
votes
1
answer
585
views
I am having issues with Ninject and MVC 5 Web api 2.2
I tried the solution in MVC5, Web API 2 and and Ninject but the package breaks my build(System.Web). I have also tried the "Ninject.MVC3" Package. When i fix it with "Update-Package -reinstall ...
2
votes
1
answer
543
views
Ninject WebApi error for parameterless controller
I've read every Stack Overflow question I can find but to no avail. When I installed the Ninject packages through NuGet, the NinjectWebCommon.cs class was not installed, so I coded up my own (below). ...
0
votes
1
answer
335
views
Parameterless constructor error when using Ninject with WebAPI on IIS, runs fine when debugging locally
When I run my WebAPI project from Visual Studio it runs perfectly. But when I publish to the file system and copy the files to my IIS folder and run it, it fails with the error: An error occurred when ...