Asp.Net configure routes of multiple mvc projects

Asked

Viewed 67 times

0

So I can understand how this multi-project MVC architecture works in a Solution.

How to communicate (a link) from one project to another within the same project?inserir a descrição da imagem aqui

For example, I would like in the Management Home View I get a link to View Home Port.inserir a descrição da imagem aqui

I did some research, but I didn’t find much content and the ones I thought were pretty vague. If you can leave an example of route configuration and others, thank you.

  • I believe this is not possible, but there are ASP.NET MVC experts... I think you can only share business rule via DLL even.

  • Maybe your case is a problem XY, what are you trying to solve? I believe in your scenario to use Areas be a solution. Passing a URL from another site/system is simple, but they will not share resources, example 1 ViewBag

  • We want to migrate from areas to projects. The portal has grown a lot and when we need to publish something in an area, we end up stopping the rest of the portal. The is different when working with multiple projects. We only publish the one that suffers change.

1 answer

0

Routes you use when working with MVC Areas, i.e., {url}/{area}/{controller}/{view}. In this case you have more than one MVC project and each project can be an application or a sub-application on IIS. For one application to access another you can configure iis local to run the applications independently, for example:

  • Management - local.managemento.com
  • Concierge - local.portaria.com

For one application to access the other you will make this note through links. In the ordinance application you will have links pointing to local.management.com and vice versa. This solution can generate an authentication problem. If you log into the management application and try to access some page of the ordinance application that requires authentication you will be denied access. This problem can be solved through solutions such as identity servers (e.g., Identity Server) or by configuring machine key on IIS. Assess whether this separation is really necessary, as it can increase the complexity of your system. If you’re having trouble publishing a fix and another one comes up consider using unit testing and integration integrated with an automated build process.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.