0

enter image description here

Hello everyone, I wish you a healthy day.

I have two different MVC projects, I want my project to run under path localhost:5001/admin/ and the other project to run under localhost:5001/member/ path. I want to start both projects within the same main function.

I don't want the two projects getting mixed up due to a large number of controllers and views.

I ran it under the Areas folder, however, because the project is very large, I noticed that the files were mixed with each other, so I want to run it in two different layers, but in the same solution.

Some hosting companies do not allow for two separate web tiers, so I want to combine two different web tiers in one project.

Jackdaw
  • 7,626
  • 5
  • 15
  • 33
  • AFAIK You can't do this with kestrel web server. The only way I know this could work is if you used IIS Express and set each web project as a [virtual directory](https://josephwoodward.co.uk/2014/01/how-to-create-a-virtual-directory-in-iis-express). – Erik Philips Jun 13 '21 at 06:53
  • @ErikPhilips I'm wondering if I can solve this with code because as if I am creating layer instead of creating area, how can I create it like an area by layering. – mustafacelebi0 Jun 13 '21 at 06:58
  • @ErikPhilips What I mean to you is, how can I use my controllers and views from a different layer? – mustafacelebi0 Jun 13 '21 at 07:00
  • Does this help https://learn.microsoft.com/en-us/aspnet/core/mvc/advanced/app-parts?view=aspnetcore-5.0 – Adith Sukumar Jun 13 '21 at 07:05
  • @AdithSukumar I tried this. Thanks a lot for your valuable comment. But I'm looking for a better way, I don't want to need any code changes when I separate the layers. – mustafacelebi0 Jun 13 '21 at 07:11
  • Does this answer your question? https://stackoverflow.com/questions/4372548/setting-an-alternate-controller-folder-location-in-asp-net-mvc – Erik Philips Jun 13 '21 at 07:53
  • @ErikPhilips This just allows me to use controller from another layer, I want to use both controller and views from another layer. – mustafacelebi0 Jun 13 '21 at 08:16

0 Answers0