Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run ASP.NET MVC and WebAPI projects in the same time?

I am developing a complex web-platform with n-tier architecture. There are two projects inside solution: PresentationLayer.WebSite and APILayer.Restful.

Local database stored in App_Data inside PresentationLayer.WebSite. I have no idea how to implement following actions : (currently I'm workind in debug mode).

  1. Set connection string from Restful project to Presentation Project. Should I use absolute path? They should use the same DB. Of course, in publish moment DB will be placed in some server,but what to do now?
  2. How can I run two projects in the same time? I know how to call one's project's controller from another, but how to run it togetgher? For example: in Chrome I call User\MyProfile?.... (Presentation) and in Firefox i call Api\User\GetUserById... (Rest).
like image 471
Iskander Raimbaev Avatar asked May 22 '16 09:05

Iskander Raimbaev


1 Answers

Right click on your solution and select Properties. In the "Startup Project" select "Multiple startup projects" and set "Action" of your projects to "Start"

like image 94
Kahbazi Avatar answered Nov 11 '22 18:11

Kahbazi