3

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:

  • Error:

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

  • Layout Path

    @{ Layout = "~/Views/Shared/_Layout.cshtml"; }

Ali Sultan
  • 133
  • 1
  • 3
  • 14

2 Answers2

6

Check this:

  1. Go to _Layout.cshtml properties
  2. Build action must be equal to Content
MiMenda
  • 81
  • 1
  • 4
2

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

Ali Sultan
  • 133
  • 1
  • 3
  • 14