Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Areas in different project with ASP.NET MVC 4

I am working with ASP.NET MVC 4, and trying to have areas in separate projects.

I have been checking this thread where we are anticipated the non-supporting state of areas in different projects after ASP.NET MVC2:

What are the pros and cons of Areas implemented as single projects vs multiple projects in asp.net mvc

Anyone know if it is true that it is not supported anymore?

Could anyone help me to find out if there is a common way to have areas in separated projects when using ASP.NET MVC 4?

I have found this other thread that may help, but was looking for a more common way:

ASP.NET MVC 4 Areas in separate projects not working (view not found)

Thank you!

like image 641
user2558401 Avatar asked Jul 07 '13 16:07

user2558401


People also ask

What are areas in ASP.NET MVC?

Area allows us to partition the large application into smaller units where each unit contains a separate MVC folder structure, same as the default MVC folder structure. For example, a large enterprise application may have different modules like admin, finance, HR, marketing, etc.

What are the topics in MVC?

The topics which I have covered in this tutorial are Controller, View, Routing, Data Sharing from view to controller and controller to view, Razor, HTML Helper Class, Model, Validation, Master Page, Partial View, scaffolding , ajax,area , Authentication, web api etc with example.

What is the difference between MVC 4 and 5?

Authentication filter is not available in MVC4 where as Authentication filter is available in MVC5. Authentication filter is a new kind of filter in ASP.NET that runs prior to the authentication in MVC. 3. Filter over ride feature is not available in MVC4 where as this feature is available in MVC5.


2 Answers

Different projects are like different sites in one solution. They do not depend on each others. Each Area has own routing registration.

You can check this. May be it will help:

ASP.NET MVC 4 Areas in separate projects

like image 26
Jeyhun Rahimov Avatar answered Oct 18 '22 10:10

Jeyhun Rahimov


The answer is most likely no, but I can't provide a definitive source as it concerns > version 3.

This was written in 2010:

I'm the development lead on ASP.NET MVC at Microsoft.

There are no plans to include multi-project areas in ASP.NET MVC 3. However, it's definitely an area that we plan to revisit in the future.

In the meantime MvcContrib's solutions are probably the best bet. The MVC Futures download still includes an old (and perhaps only semi-functional) version of the original multi-project areas feature. Because the full source code for it is also available, you might be able to construct a solution that is customized to your needs.

Currently, the areas template as provided in VS2013 does not provide an out of the box solution for this. My assumption would be that it is "possible" but not supported. The greater question would be, what scenario are you encountering where it is necessary to put your areas into different projects?

like image 127
NickSuperb Avatar answered Oct 18 '22 11:10

NickSuperb