The layout page "~/Views/Shared/_Layout.cshtml" could not be found
Posted
by
Rei Brazilva
on Pro Webmasters
See other posts from Pro Webmasters
or by Rei Brazilva
Published on 2013-05-16T17:04:42Z
Indexed on
2013/11/12
22:04 UTC
Read the original article
Hit count: 309
web-development
|asp.net-mvc
I got this error and I can't figure out what is going on. I am positive the _layout.cshtml resides in the shared folder and for the sake of trying things out, I moved to the Home folder and it then told that the Views/Home/_Layout.cshtml couldn't be found there either. So now I'm thinking the problem is in the call for this file for some reason.
I'm not going to pretend I know ASP.NET MVC4, so please when you answer, explain it as you would to someone who is not familiar with the system at all. Believe it or not, this error came from tutorial #1 ha ha
Here's the code to show that I did code it right:
@{
ViewBag.Title = "Home Page";
Layout = "~/Views/Shared/_Layout.cshtml";
}
And here is a picture of the location
p.s. I did my research, Google has nothing and there is another question here but it was asked on 2008 with MVC3 which is completely different
I am running ASP.NET MVC4 on Azure
Thanks
© Pro Webmasters or respective owner