How to add Areas in Visual Studio 2017 & 2019

   Let's discuss Area first & use of Area in Asp.Net MVC application. Area is one of the most important components of ASP.NET MVC application. It helps to separate big application into units which are very handy to maintain. For instance, if you have an Asp.Net application with different roles you can create Areas for each of the roles and maintain their logical units, each unit will have their own logical components views, controllers, and models.
There are minor changes in visual studio 2017/2019 and the Asp.Net team has removed the 'Add Area' option from context menu but they still support the 'Area' feature. Area is not removed from visual studio 2017/2019 but it is moved in Scaffolding and you can access the area from there.

Here are the steps to access the Area option in visual studio 2017/2019:

1) Right-click on your project and you will see following options (see screenshot below)

Visual Studio options

2) Now, click on Add > New Scaffolded Item


3) After click choose the MVC area from the Menu 


4) Just name your Area, and then Area will be added to your project.


Post a Comment

If you have any questions or concerns, please let me know.

Previous Post Next Post