I recently created a solution that contains a Web API 2 project (provides JSON data for mobile devices) and a class library (including my data access services).
The Web API project uses Ninject for DI, and everything works fine.
Now I need to add a separate MVC project for several web pages. Api should be available from www.example.com/api/controller , and the website should be accessed through www.example.com/controller .
The problem is that each of these two has a different βCheck-inβ method with seemingly incompatible route collections. If I install the MVC project as a launch project, routes for api are not registered and vice versa. If I install Mutiple startup projects, they will work on different ports that are not my cup of tea.
How can I set the MVC project as a startup when registering all routes for them?
One more thing. Since the Web API project was created earlier, the Ninject configuration was written to it. Of course, some of the services from the class library project are needed in the new MVC project. Do I need to move the Ninject configuration to the MVC project or do they just work because they start when the web API project starts?
source share