asp.net-core-mvcasp.net-mvc-areas

The layout view '~/Views/Shared/_Layout.cshtml' could not be located


The below image shows the project structure I am working on:

enter image description here

Inside Areas -> Billing -> Views -> _viewstart.cshtml, I have specified the path to the layout which I want to apply to the entire application but I keep getting the following error:

InvalidOperationException: The layout view '~/Views/Shared/_Layout.cshtml' could not be located. The following locations were searched: ~/Views/Shared/_Layout.cshtml


Solution

  • I was able to find a solution to my issue, by moving the layout to the root folder as shown in the below image:

    enter image description here