Ali Sultan
Ali Sultan

Reputation: 135

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

Upvotes: 3

Views: 18308

Answers (3)

Development
Development

Reputation: 21

missing @RenderSection("scripts", required: false)

Upvotes: 2

MiMenda
MiMenda

Reputation: 111

Check this:

  1. Go to _Layout.cshtml properties
  2. Build action must be equal to Content

Upvotes: 9

Ali Sultan
Ali Sultan

Reputation: 135

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

Upvotes: 2

Related Questions