Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • 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"; }

like image 902
Ali Sultan Avatar asked Apr 19 '26 05:04

Ali Sultan


1 Answers

Check this:

  1. Go to _Layout.cshtml properties
  2. Build action must be equal to Content
like image 107
MiMenda Avatar answered Apr 23 '26 02:04

MiMenda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!