The view ‘Index’ or its master could not be found. The following locations were searched

One of ASP.NET MVC errors wasted one hour of my life today (of course, it is many times less than this season’s leader SharePoint) but this is still one hour. “The view ‘Index’ or its master could not be found. The following locations were searched” error raised suddenly and I was not able to get over it. Well, this time solution was simple.

The error was:

The view ‘Index’ or its master could not be found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx

It tells about page requested but doesn’t mention exactly what is missing. In my case it was one MvcUserControl that was missing. After inserting correct name for it the error disappeared and everything worked again.

Gunnar Peipman

Gunnar Peipman is ASP.NET, Azure and SharePoint fan, Estonian Microsoft user group leader, blogger, conference speaker, teacher, and tech maniac. Since 2008 he is Microsoft MVP specialized on ASP.NET.

    6 thoughts on “The view ‘Index’ or its master could not be found. The following locations were searched

    • March 30, 2009 at 2:40 am
      Permalink

      Any hints?
      I’m trying to walk through NerdDinner (chapter 1 from Professional ASP.NET MVC 1.0), and frustrated by this error.

    • July 25, 2009 at 9:07 pm
      Permalink

      I know this is a weird error. Does come for various reasons.

    • January 26, 2010 at 10:30 am
      Permalink

      Your article isn’t very helpful.

      “In my case it was one MvcUserControl that was missing. After inserting correct name for it the error disappeared and everything worked again.”

      Thanks.

    • March 4, 2010 at 3:58 pm
      Permalink

      I fixed this error by changing the Index method from

      return View(_db.MovieSet.ToString());

      to

      ViewData.Model = _db.MovieSet

    • March 19, 2010 at 1:56 am
      Permalink

      any one of your included file is not in place

    • April 8, 2011 at 3:18 am
      Permalink

      In web.config,remove attributes of “pages”

    Leave a Reply

    Your email address will not be published. Required fields are marked *